Hello,
I would like to manually acknowledge each message I receive from the Solace queue using the JMS protocol. However with the configuration I have below, I am seeing that the messages are actually not being removed even after I explicitly call “message.acknowledge()” on the message.
@Bean()
public DefaultJmsListenerContainerFactory connectionFactory(SolConnectionFactory solConnectionFactory, SolaceErrorHandler errorHandler) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(solConnectionFactory);
factory.setErrorHandler(errorHandler);
factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
return factory;
}
I couldn’t really find much documentation on manually ack-ing each message in the application. Should I be changing something here?
Hi @asx19 ,
Are you using the @JmsListener annotation on the receiving method?
If yes, can you try adding a name of “jmsListenerContainerFactory” to your DefaultJmsListenerContainerFactory bean and seeing if that works for you?
@Bean(name = "jmsListenerContainerFactory")
public DefaultJmsListenerContainerFactory connectionFactory(SolConnectionFactory solConnectionFactory) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(solConnectionFactory);
factory.setErrorHandler(errorHandler);
factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
return factory;
}