Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between RMI and ActiveMQ

I'm currently trying to get comfortable with multi tier applications (Server / Client Architecture). For that I created Service Interfaces and the associated Service Implementations.

Both modules - the Client and the Server - knowing the Interfaces (included via build path).

The purpose of the application is that the client can receive data from the server and also send data to the server where it become stored into a database.

It seems so that I need a communication into both directions. Is the "standard" Java RMI the correct approach for that or do I need to use a JMS implementation like ActiveMQ?

I can't see the main difference between the two approaches? Is the only one that RMI is synchronous and JMS asynchronous or is there more than that?

Futhermore, can you recommend an ActiveMQ tutorial or even book?

like image 606
mhmpl Avatar asked May 09 '26 15:05

mhmpl


1 Answers

We're talking of two different technologies here, each with different usage scenarios. RMI is a Java application programming interface (API) which enables remote invocation of methods between Java programs, and its intended use is for building synchronous, distributed applications. RMI is the Java equivalent of remote procedure calls (RPC).

On the other hand, ActiveMQ is a product, a message oriented middleware (MOM), useful for receiving and processing asynchronous messages (queues or topics), and Java applications would typically communicate with such a system by using the JMS API.

You would use RMI when you need to communicate with another Java application in a distributed, synchronous fashion, whereas you would use JMS for sending messages to be processed asynchronously, and in principle the processing could involve systems written using any other technology, not just Java (unlike RMI).

Asynchronous messaging is typically used for solving the architectural problem of integrating disparate systems, a very good (technology-agnostic) book on the subject is Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions.

Finally, ActiveMQ in Action is a nice book on ActiveMQ.

like image 188
Óscar López Avatar answered May 11 '26 05:05

Óscar López



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!