I am trying a very simple route with Spring Boot 1.5.2.RELEASE + Camel (Spring Boot Starter) + ActiveMQ, which is to read from a particular queue and then log it. However, i
First you should add the spring-boot-starter-activemq
dependency to your pom.xml. Then you can use its AutoConfiguration capabilities which will create a ConnectionFactory
based on the properties you have specified in your application.yml.
After that you have to configure Camel's ActiveMQComponent
too. If you would like to reuse the ConnectionFactory
(which created by the autoconfig) then it can be achievable with the following:
@Configuration
public class ActiveMQComponentConfig {
@Bean(name = "activemq")
public ActiveMQComponent createComponent(ConnectionFactory factory) {
ActiveMQComponent activeMQComponent = new ActiveMQComponent();
activeMQComponent.setConnectionFactory(factory);
return activeMQComponent;
}
}
You can find more information in Camel's ActiveMQ documentation.