RMI via JMS RMI (Remote Method Invocation) is a Java-based technology that allows one Java Virtual Machine (JVM) to invoke methods on objects that reside in another JVM. RMI enables distributed.. 已关注

提示信息
RMI via JMS
RMI (Remote Method Invocation) is a Java-based technology that allows one Java Virtual Machine (JVM) to invoke methods on objects that reside in another JVM. RMI enables distributed computing by allowing objects to make method calls on remote objects as if they were local objects. JMS (Java Message Service) is another Java-based technology that provides a messaging standard for Java applications. It allows applications to exchange asynchronous messages reliably, ensuring that messages are delivered once and only once. RMI via JMS is a combination of these two technologies. It involves using JMS as the underlying communication layer for RMI method invocations. Instead of directly invoking methods on remote objects over network sockets, RMI via JMS uses JMS messages to send method invocations and receive method responses. The basic idea is that the RMI client sends a JMS message containing the method invocation details to a JMS destination, such as a queue or a topic. The RMI server listens to this destination, receives the JMS message, and processes the method invocation on the corresponding object. Finally, the RMI server sends back the method response by publishing another JMS message to a reply destination, which the RMI client is listening to. RMI via JMS has some advantages over traditional RMI over network sockets. It provides additional abstraction and decoupling, as RMI clients and servers can be loosely coupled through JMS messaging. It also enables the use of asynchronous messaging, allowing clients to continue execution while waiting for the method response. However, RMI via JMS also introduces additional complexity and overhead compared to traditional RMI. It requires setting up and configuring JMS, and the serialization/deserialization of Java objects into JMS messages adds extra overhead. Therefore, RMI via JMS is typically used in scenarios where the benefits outweigh the additional complexity, such as in distributed enterprise applications where messaging infrastructure already exists.
  • 1
  • 文章
  • 0
  • 关注人数
×

小程序:无忧编码

手机扫一扫

 

Copyright © 2020 京ICP备16023093号-6   京公网安备 11010802031226号