I'm trying to read the messages asynchronously from azure service bus topic. I have created the JMS Listener based on MS documentation
@JmsListener(destination = TOPIC_NAME, containerFactory = "topicJmsListenerContainerFactory",
subscription = SUBSCRIPTION_NAME)
public void receiveMessage(User user) {
logger.info("Received message: {}", user.getName());
}
I need to ensure whether topicJmsListenerContainerFactory container factory supports asynchronous processing ?
I tried Implementing the DefaultJmsListenerContainerFactory like below, but by using this I can't able to fetch any messages from service bus top. It throwing an exception The messaging entity could not be found. I'm able to fetch messages by using topicJmsListenerContainerFactory container factory
@Bean
@ConditionalOnMissingBean(name = "jmsListenerContainerFactory")
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(DefaultJmsListenerContainerFactoryConfigurer Configure, ConnectionFactory connectionFactory) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
Configure.configure(factory, connectionFactory);
return factory;
}
Reference :
How to create DefaultMessageListenerContainer in Spring-Boot?
Any one please advise on this ?
