Chapter 9. Spring Integration and the Java Message Service

 

This chapter covers

  • How Spring Integration and JMS fit together
  • Sending and receiving JMS messages with Spring
  • JMS gateways and channel adapters

For many Java developers, the first thing that comes to mind when they hear “messaging” is the Java Message Service (JMS). That’s understandable considering it’s the predominant Java-based API for messaging and sits among the standards of the Java Enterprise Edition (JEE). The JMS specification was designed to provide a general abstraction over message-oriented middleware (MOM). Most of the well-known vendor products for messaging can be accessed and used through the JMS API. A number of open source JMS implementations are also available, one of which is ActiveMQ, a pure Java implementation of the JMS API. We use ActiveMQ in some of the examples in this chapter because it’s easy to configure as an embedded broker. We don’t go into any specific ActiveMQ details, though. If you want to learn more about it, please refer to ActiveMQ in Action by Bruce Snyder, Dejan Bosanac, and Rob Davies (Manning, 2011).

9.1. The relationship between Spring Integration and JMS

9.2. JMS support in the Spring Framework

9.3. Asynchronous JMS message reception with Spring

9.4. Sending JMS messages from a Spring Integration application

9.5. Receiving JMS messages in a Spring Integration application

9.6. Request-reply messaging

9.7. Messaging between multiple Spring Integration runtimes

9.8. Managing transactions with JMS channel adapters and gateways

9.9. Summary