From the course: Spring: Messaging with JMS

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Read from ActiveMQ message queue

Read from ActiveMQ message queue - Spring Tutorial

From the course: Spring: Messaging with JMS

Start my 1-month free trial

Read from ActiveMQ message queue

- [Instructor] We're going to modify the receiver.java class, clean and build the app, and then run the app. We will look back at the ActiveMQ web console to verify the messages have been read off the queue. Let's go back to our receiver class and remove the comments we placed previously. We will also modify the JMS listener annotation and remove the connection factory property since this will now be set via a new Spring configuration bean. Back on the application.java class file. Let's go to the application class file now. We will add a default JMS listener container factory bean. And we're gonna type the following: DefaultJmsListenerContainerFactory, we'll call this a factory and we'll initialize it with a new default listener Container Factory. With the factory created, we will set our connection factory and we'll use the connection factory we created earlier. The other thing we're gonna do here, is we're gonna set the factory concurrency level. And we'll set this to 1-1. And then…

Contents