开发者

JAVA Messaging Service

I am looking to exchange messages between 开发者_JAVA百科Java classes which are running as part of different Java processes (or JVMs). For example: a Java class which has detected an event will wrap it up as a Java message and send it to an event handling class running inside a different Java process.

What's a simple and well established approach to such messaging? Since the messaging will always be between Java classes, I do not want the overhead of XML SOAP or the complexity of Corba.

Thanks Neel


The standard solution would be JMS. But it seems its very heavy weight for your needs. I would suggest to write a small TCP layer using MINA or something and build a custom solution over it.


You might want to look at Spring-Integration. It has options for both external and internal messaging. You can use JMS, TCP packages, all kinds of stuff.


If you don't need the asynchronous aspect, simple RMI will do.


One option is Jini, now referred to as Apache River.

Jini will help with discovery and serialization. It allows you to call a method in one class from another class running in a different JVM.

Jini is fairly elegant. It's easy to specify which methods are exposed to remote callers. Exceptions from the called method are communicated as exceptions to the caller. Discovery supports painless redundancy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜