Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top