Fork me on GitHub
#ring
<
2016-11-14
>
sandbags20:11:39

How are people, who are using jetty in production, configuring their applications? I am thinking e.g. database configuration or mandrill configuration. I can find any number of "Clojure web application" guides which sidestep any configuration issues. I feel like I must be missing something essential that speaks to this problem.

sandbags20:11:14

Deploying a Rails app, e.g. with Capistrano, you had a set of places where you could drop such things. Deploying an app as a war file into, e.g. /usr/share/jetty/webapps there doesn't seem to be a structure. I was considering whether some kind of plugin could "package" a config file into the war file that could be read at run-time. Feel potentially clunky tho.

seancorfield21:11:42

We have a homegrown configuration library right now but we’re planning to move to something a bit more standardized (and will probably open source it). We use Component for managing all the startup stuff.

seancorfield21:11:47

We start Jetty (or http-kit) as part of that Component startup process.

seancorfield21:11:20

We create an uberjar of our app. We don’t create a WAR and we don’t deploy it to a web container.

seancorfield21:11:48

We will be using an environment variable to tell the app, at startup, where to find the configuration file (which lives on each server, outside the app). Right now we just use a standard location but that won’t scale as we add more apps.

sandbags21:11:14

@seancorfield seems we rock up in a lot of the same places 🙂

sandbags21:11:52

so you're running your app through an embedded jetty and using java -jar to start it? (Hence able to use -Denv to configure)?

seancorfield21:11:44

We actually let the app choose Jetty or http-kit at startup based on a command line option (or environment variable).

sandbags22:11:32

maybe i should switch to this method... using uberwar seemed simpler but i am baffled as to how one configures such an app

seancorfield22:11:09

I think deployment is a lot simpler this way. You can easily control which web server to use, which port to listen on etc.

sandbags22:11:27

i think you may be right. My ops guy is talking about something called Wildfly, not sure if you've come across it