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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access