user3378550
user3378550

Reputation: 139

Spring boot activemq overriding the connection factory

I am new to Spring boot and i am trying to lookup my own connection factory instead of using the default 'ConnectionFactory' which Spring boot provides and also trying to lookup the already defined queue without using dynamicqueues.

How can i do that? Should i add jndi.properties file and add it there so i can lookup?

Can someone suggest?

Upvotes: 1

Views: 4199

Answers (1)

Hassen Bennour
Hassen Bennour

Reputation: 3913

The Spring Integration configuration by default is looking for a Spring Bean called ‘connectionFactory’.

Spring Boot by default, creates the JMS connection factory using the name ‘jmsConnectionFactory’.

@Bean
public ConnectionFactory jmsConnectionFactory() {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
    return connectionFactory;
}

https://github.com/spring-projects/spring-boot/blob/v1.5.9.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java

Upvotes: 1

Related Questions