I'm not sure what an email classifier is. But in any such problem, the best solution is I recommend creating a RESTful API for your java service. This can be done very elegantly with the right tools. The API must be over HTTP, which returns JSON. Use a library like Jackson , which is serialized in JSON.
On the ruby ββside, you can easily parse JSON and deserialize.
This is a very scalable solution because HTTP calls are stateless and are already scalable. The thread is used and discarded. If you need more energy, just add more cars.
A Rails application can also trigger caching of certain calls. But this is premature optimization.
, . , Java- . API. Ruby. JSONP AJAX , JSON.