Java – interprocess communication between wars in the same container

What is the choice between two wars running in the same jetty container to achieve low latency communication?

I basically need to call a service in a war, but I can't afford to call it Web services.

Since they run in the same JVM, I want to avoid using RMI / JMS, etc., but I don't know what other options are available?

I've seen the communication between servlets, but since the direct method call is deprecated, it doesn't seem to be the right choice?

I also found kyronet, but is there a better solution because it is in the same JVM?

What I'm looking for is a VM component like Apache camel (Seda between network applications), but since only one application uses camel to do this, it's not an option

I know I may have to share some DTOs between wars, but please don't suggest pulling services into a shared library. If this is an option, I won't ask this question:)

Edit:

Embedding EJB containers may not be an option

Solution

Register the interface with JNDI and make it global so that "other" servlets can retrieve them from the repository

Check this

(Note: we gave up JNDI to support our own registry implementation, but we started the registry and jetty programmatically in the same JVM)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>