0
votes

I have a jms-message-driven-channel-adapter receiving messages from a Queue. I am passing the message to a router which based on some parameter is sending the messages to spring beans configured as Service Activators.

I want the messages to be removed from the JMS queue only after the spring beans have processed the message. Else the message should not be removed the the queue.

I tried putting all the above flow inside the chain but the jms-adapter is not compatible with the chain. I am new to spring-integration. Please let me know how to implement this.

1

1 Answers

0
votes

As long as you use (default) direct channels between all the components, the flow will run in a transaction and the message will be removed (committed) when the flow completes; just set acknowledge="transacted" (the default since version 4.2).

If the flow throws an exception, the message will be requeued (rollback).