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 - Spring Tutorial
From the course: Spring: Messaging with JMS
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.