Chapter 8. Spring and JMS — Message-Driven POJOs

Many enterprise applications throughout the world have a need to communicate reliably. In fact, many of these applications are part of our daily lives, dealing with things like banking, credit cards, financials, telecommunications, and travel reservations. Consider that when you make travel reservations using one of the many travel websites, many applications are behind the scenes to facilitate the creation of those reservations. In applications such as these, a request from one application to another must not fail. Those requests cannot be dropped or lost, even in times of system failure. For application-to-application communication, messaging is the best solution. Enterprise messaging solutions are known as message-oriented middleware (MOMs).

MOMs allow applications to communicate by sending and receiving messages. A message is a unit of business data (a payload) with some routing information that is used to advise other applications of business events. MOMs serve as an intermediary that facilitates the reliable exchange of messages using destinations. By means of the routing information, messages are sent to a destination provided by the MOM, not to any specific application. Applications that are interested in the messages register or subscribe to the destination to receive messages. This paradigm allows the applications sending messages and the applications receiving messages to be completely separate. This is the concept of

Get Beginning Spring Framework 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.