Spring Book – Chapter 17 – Messaging with Spring

Receiving Messages

Similar to “send” methods, JmsTemplate offers four variations of “receive” methods namely “receive”, “receiveSelected”, “receiveAndConvert” and “receiveSelectedAndConvert”. Listing 18-19 below shows a sample class which is used to receive messages using Spring JMS.

Listing 18-19. Sample which shows receiving of message using Spring JMS

The corresponding bean declaration in Spring configuration file is shown in Listing 18-20 below.

Listing 18-20. Bean declaration of test message receiver class with objects injected

The variations of “receive” methods can be summarized as shown in Listing 18-21 below.

Listing 18-21. Variations of “receive” methods in JmsTemplate class

Page Visitors: 16775

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

1 thought on “Spring Book – Chapter 17 – Messaging with Spring

  1. First of all I would like to say fantastic blog! I had a quick question which I’d like to ask if you don’t mind. I was interested to know how you center yourself and clear your head before writing. I have had difficulty clearing my mind in getting my ideas out there. I do enjoy writing but it just seems like the first 10 to 15 minutes are usually wasted just trying to figure out how to begin. Any recommendations or tips? Thank you!|

Leave a Reply

Your email address will not be published. Required fields are marked *