Skip to Main Content
Java Message Service, 2nd Edition
book

Java Message Service, 2nd Edition

by Mark Richards, Richard Monson-Haefel, David A Chappell
May 2009
Intermediate to advanced content levelIntermediate to advanced
330 pages
10h 34m
English
O'Reilly Media, Inc.
Content preview from Java Message Service, 2nd Edition

Chapter 9. Spring and JMS

The Spring Framework provides built-in support for JMS that greatly simplifies the development of messaging-based applications. For synchronous message sending and receiving, Spring provides a JMS template that abstracts the developer from the details of the JMS API. For asynchronous message receiving, Spring provides a framework that allows regular POJOs to act as asynchronous message listeners (also known as message-driven POJOs, or MDPs). Message-driven POJOs are similar in nature to the message-driven beans discussed in the previous chapter. However, unlike message-driven beans, MDPs can be created using standard POJO business objects that optionally have no knowledge of messaging or JMS.

This chapter introduces JMS messaging using version 2.5 of the Spring Framework. We will start by reviewing the overall architecture and components of Spring’s messaging framework, and then describe the details of connecting to a JMS provider, sending messages, receiving messages synchronously, and creating message-driven POJOs to receive messages asynchronously. In the last section (The Spring JMS Namespace), we will discuss the new Spring JMS namespace, which simplifies the configuration for Spring-based JMS containers and listeners.

Spring Messaging Architecture

The JMS template and the message listener container are the two main components within the Spring Framework for using JMS messaging. Spring’s JMS template (JmsTemplate) is used when sending messages or receiving ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reactive Systems in Java

Reactive Systems in Java

Clement Escoffier, Ken Finnigan
Java 8 in Action

Java 8 in Action

Mario Fusco, Alan Mycroft, Raoul-Gabriel Urma
The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Benjamin Evans, Martijn Verburg, Jason Clark

Publisher Resources

ISBN: 9780596802264Supplemental ContentErrata Page