0
votes

We have the following issue in our application. Messages come in on an inbound channel adapter, and are accumulated in an aggregator using a persistent message store. Once the condition defined in the release strategy returns true, the messages are sent to the next stage in the processing. If an exception is thrown at that next stage of processing, the transaction will be rolled back and the messages placed again in the persistent message store. However, the transaction will not place the messages back on the original queue, as messages are acked once they are placed in the aggregator. This is not what we want. Ideally, if an exception occurs when processing downstream one of the messages that the aggregator has batched, only that single message for which an error occurred would be rolled back by the transaction and placed back on the original queue. Is there anyway using Spring Integration to do this?

Thanks

1

1 Answers

1
votes

Not built-in; you would have to do your own error-handling and requeue the failed message.

To insert error handling downstream of the aggregator you can add a service activator that invokes a gateway (with a method that returns void), and add an error-channel to it.

The ErrorMessage on the error channel will have a payload that's a MessagingException with cause and failedMessage properties.