I have small rabbitmq spring boot application:
@Bean
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory)
{
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setConnectionFactory(connectionFactory);
factory.setAcknowledgeMode(AcknowledgeMode.AUTO);
return factory;
}
Simple queue definition:
@Bean
public Queue queue()
{
return new Queue("queue");
}
And a simple listener which logs the message:
@RabbitHandler
public void process(@Payload Message message)....
I am seeing that the same message is being sent multiple times before the removed from queue.
How can i change this config to ensure the message is sent exactly once.