Synchronous vs. Asynchronous Systems

RMI or CORBA is for tightly coupled synchronous communications, and JMS is for loosely coupled asynchronous communications.

However, there are other important factors to consider. My point of view is that JMS is a better choice because it offers the flexibility of both models. In any distributed application you will find uses for asynchronous processing if you look hard enough, even if you start out with a bias towards a synchronous design. Using JMS for both synchronous and asynchronous processing gives you a single programming model.

JMS also provides an asynchronous request/reply model, using the JMSReplyTo message header. This allows a distributed system to withstand failures and scheduled downtimes of the various nodes in the environment without affecting the health and availability of the system as a whole.

How scalable is the RMI or CORBA solution compared to the JMS solution? If you mix and match the two technologies, your system as a whole is only as strong as its weakest link. Using JMS for pure request/reply interactions buys you some important fault-tolerance advantages:

The traditional client (requestor) and server (replier) are decoupled using a JMS topic or queue. Let's assume it's a topic:

  • You can have more than one replier listening to the same topic for requests.

  • If one of the repliers dies, then you still have other repliers left answering client requests. This N-way-redundancy is transparent to the client: Client requests are "multicast" to all the repliers. Every replier responds, but the client considers only the first arriving response.

Another advantage of request/reply using JMS is preventive maintenance. Assume there is only one replier this time:

  • While your clients are performing requests through a JMS topic, you can move the replier from one machine to another. The client will not throw any exception but transparently start using the new replier machine. No data is ever lost during the transition from one machine to another. That's an important feature if you want to achieve twenty-four seven operation.

All of that is very hard to achieve with a synchronous model like CORBA, DCOM, or RMI. A JMS messaging server, being a Message-Oriented Middleware (much like MSMQ or MQSeries) can buy you much more of a really scalable and fault-tolerant solution.



Professional JMS
Professional JMS
ISBN: 1861004931
EAN: 2147483647
Year: 2000
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net