O'Reilly logo

Just Spring Integration by Madhusudhan Konda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JMS Adapters

The Spring Integration framework provides good support for integrating Spring applications with Java Messaging Service (JMS).

If you are new to JMS, I would recommend reading my Just Spring book that explains the concepts of JMS at a high level.

The framework provides inbound and outbound adapters for receiving and sending messages across to external messaging systems. The inbound adapters will pick up a message from a JMS destination (topic or queue) and publish them onto local channels. On the other hand, the outbound adapters will convert a local payload from a channel into JMS Message and publish to a JMS destination (topic or queue).

The jms namespace defines the relevant elements to use these adapters declaratively.

Inbound Adapters: Receiving Messages

Receiving messages from a messaging system may involve some complexity. This is due to the fact that the consumption might be driven by the consumer client or by the provider. In the former case, the client will have to poll for messages on a regular basis, while the latter case ensures that the client is given a message when it arrives on a server (hence message-driven or event-driven).

Synchronous Consumers

As explained, the inbound-channel-adapter is responsible for receiving messages from a JMS Server. The endpoint is configured to connect to a JMS Server, fetch the messages, and publish them onto a local channel. Note that this is a polling consumer. In the backend, it uses the JmsTemplate's receive method to poll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required