Explain the difference between RMI and JMS.
RMI:- RMI is tightly-coupled mechanism.
- The destination object need to be available online at the time of sending messages from client to server.
- RMI has RPC-model.
JMS:- JMS provides loosely coupled mechanism.
- The destination object need not be available online at the time of sending messages from client to server.
- JMS has messaging model.
Difference between RMI and JMS.
Remote Method Invocation (RMI) | Java Messaging System (JMS) |
Java's native RPC interface | Java's interface and specification to Message Oriented Middleware |
Remote objects can be run with similar semantics to local objects | Packets of data can be shipped to message queues and topics where they will be operated upon asynchronously. The queues or topics need not be remote |
The default implementation uses a proprietary binary communication protocol, but RMI can be implemented over SOAP | JMS server could be using RMI, SOAP, etc. |