I am using error-channel attribute on message driven endpoint. The flow is like
If error occurs anywhere in the chain above then message goes to error-channel. The SA connected to error-channel constructs custom response and put on SI channel, which puts ultimately on responseQueue(Topic).
Behavior when acknowledge attribute is set as below on the message adaptor
- if acknowledge= AUTO then original message on requestQueue gets deleted, which is what I want -- I mean the message should be removed from queue.
- if acknowledge= transacted/client then original message on requestQueue DO NOT gets deleted, which is what I don't want. As, I would not like to keep the failed message there on input request queue or would like to route the message to some ERROR queue.
For all above cases, log entries are below.
[org.springframework.jms.listener.DefaultMessageListenerContainer#1-4][org.springframework.jms.listener.DefaultMessageListenerContainer] Execution of JMS message listener failed, and no ErrorHandler has been set.
org.springframework.integration.MessagingException: failed to send message
<jms:message-driven-channel-adapter id="jmsRequestIn" destination="requestQueue" channel="priorityMessageChannelIn" max-concurrent-consumers="5"
acknowledge="transacted" connection-factory="jmsQueueConnectionFactory" extract-payload="true" header-mapper="customHeaderMapper" max-messages-per-task="5" error-channel="busErrorChannel"/>
Please let me know what I need to set or I am missing so that I get the original message deleted/consumed from the requestQueue once error-channel activator has done the job. And, I do not want to use AUTO acknowledge mode as I want message to be removed after listener execution.