develops several web applications (SPA) and Mobile applications • These different clients needs to connect to the same service (our API) Needed a REST API
vertx runmod com.company:my-module:1.0 -conf config.json & Nice for debug and dev but… in the real world ? Problem Example Log stored in /tmp Not very nice for post mortem… No restart on server reboot Not very nice for (un)expected reboot No restart on JVM crash or unexpected shutdown OOM exception? anyone? One module per JVM - Tedious to start a multi-module cluster for dev - Limit ressource usage No notice of failed startup - Bad config ? - Network port non available? - etc.
$ service vertxd start my-module Problem Solution Log stored in /tmp No restart on server reboot No restart on JVM crash or unexpected shutdown One module per JVM No notice of failed startup Reliable, robust and easy logback + Logmatic.io (ELK, etc.) init.d (systemd, upstart, etc.) Jsvc (Java Service Wrapper, YAJSW) Develop custom launcher Develop custom launcher + jsvc $ service vertxd start my-module
and sysadmin friendly: Should look like everything else on the server • Automatic start/stop on reboot/shutdown • Service start/stop priority : Maybe you want your DB to start before Vert.x ? • Nice to use: service vertxd start, can you make any simpler ?
Init phase (allocate restricted ressources) 2. Synchronous Startup phase 3. Synchronous Stop • When run as root, it can downgrade to an unprivileged user. • You can respond to SIGUSR2 ! (hot configuration reload) Apache Jsvc «Jsvc is a set of libraries and applications for making Java applications run on UNIX more easily.»