I am pretty new to Spring AMQP module. I was successful to create simple project which produces and consumes messages. What I don't understand is following:
If there is only one listener and more than one concurrent consumers are configured in SimpleMessageListenerContainer, how it will improve the performance? As per my understanding, as long as I have single listener which processes the message, no matter how many consumers(threads) picks up the messages from the queue does not matter.
Here's my code for your reference:
@Bean
public SimpleMessageListenerContainer messageListenerContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory());
container.setQueues(someQueue());
container.setMessageListener(messageListenerAdapter());
container.setConcurrentConsumers(3);
return container;
}
I am sure, I am missing something in my understanding. Can someone throw light please. Thanks in advance.