SpringBoot ActiveMQ hello world
@Bean
public ConnectionFactory connectionFactory() {
return new ActiveMQConnectionFactory(userName, password, url);
}
@Bean
public DestinationResolver destinationResolver() {
return new DynamicDestinationResolver();
}
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setClientId(id);
factory.setSubscriptionDurable(true);
factory.setConnectionFactory(connectionFactory());
factory.setDestinationResolver(destinationResolver());
return factory;
}