0

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

4

1 回答 1

1

I was using version 1.0.0 of amazon-sqs-java-messaging-lib. After changing the version to 1.0.6 I could set the parameter SessionAcknowledgeMode to AUTO_ACKNOWLEDGE.

于 2019-07-18T19:20:58.773 回答