Creating a JRuby Microservice

In the previous section, you packaged a simple Rack application that was compatible with JRuby, but a real application will require more than just Rack. In this section, you’ll package a small Sinatra-based microservice into a WAR file. Warbler is great for small services like this because it produces a portable lightweight artifact you can deploy quickly without any baggage.

Unfortunately, this service is an integral part of Twitalytics and it’s under more load than MRI can handle. Porting it to JRuby to will increase its throughput by allowing the application to process each request asynchronously. In this way, the request threads won’t block while waiting for external services or doing data processing. To begin, ...

Get Deploying with JRuby 9k now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.