Reputation: 83
I would like to know the advantages and disadvantages of using SimpleMessageListenerContainer over receiving a message manually using Spring AMQP. Another question is when we create SimpleMessageListenerContainer setting a queue, does the rabbitmq calls the listeneradaptor or does SimpleMessageListenerContainer keeps polling the queue to check for messages and calls the registered adaptor when their is message.
Upvotes: 0
Views: 905
Reputation: 174574
It depends on your requirements; the listener container gives you an async (message-driven) approach. Otherwise, if you use the RabbitTemplate
receive methods, you are polling the queue. The container does not poll the queue, the broker pushes messages to the container according to the prefetch settings (default 1) - if using ackmode AUTO.
Upvotes: 0