I'm trying to setting SQS with JMS and Spring, but when I tried to set Session Acknowledge Mode with AUTO_ACKNOWLEDGE an error appears. What should I do?
I need to desapear with my message when the application gets the message.
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
buildConnectionFactory();
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(this.connectionFactory);
factory.setDestinationResolver(new DynamicDestinationResolver());
factory.setConcurrency("3-10");
factory.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
return factory;
}
I expect to acknowledge the message from my queue when the listener gets it. But I'm receiving the actual error when I try to configure with AUTO_ACKNOWLEDGE:
Setup of JMS message listener invoker failed for destination ... trying to recover. Cause: com.amazonaws.services.sqs.AmazonSQS.deleteMessage(Lcom/amazonaws/services/sqs/model/DeleteMessageRequest;)V