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.

Send messages to ActiveMQ

Send messages to ActiveMQ - Spring Tutorial

From the course: Spring: Messaging with JMS

Start my 1-month free trial

Send messages to ActiveMQ

- [Instructor] Let's now add configuration information to connect to and send a message to our ActiveMQ server. Look again at the application.java class file. We're going to be adding some more Spring configuration beans here as well as removing some. First, because we are going to be connecting directly to and external ActiveMQ instance, we need to configure our connection factory by adding an ActiveMQ connection factory method, so we'll type public ActiveMQ connection factory and we'll call it a connection factory, and we'll instantiate an ActiveMQ connection factory object, supplying it with the connection details and the password with the broker information, and then we'll return the factory. The next Spring configuration bean we'll add is a JMS template bean. Previously, we used the one provided by Spring Boot. It used an internal ActiveMQ instance that was stood up by Spring Boot. Now, we are configuring our JMS template bean to use the connection factory we have just specified,…

Contents