I am currently using an IntegrationFlow to trigger a Job execution when RabbitMq messages arrive in a queue. Both the IntegrationFlow's AmqpInboundChannelAdapter and the job's first step's ItemReader are configured to read messages from the same queue.
The issue that I am having is that the IntegrationFlow's AmqpInboundChannelAdapter reads the RabbitMQ message, and the ItemReader then can no longer find that message. Probably because the IntegrationFlow acknowledges the message before the Job launches.
Is there a way to keep the IntegrationFlow from consuming/acknowledging the message, leaving it in the queue so that the ItemReader can work as intendend? I tried configuring the AmqpInboundChannelAdapter to requeue the Message, but that simply caused an infinite loop of the Adapter re-reading it's own message.
This question describes my problem somewhat, except that I am doing no processing, I am simply trying to use the IntegrationFlow as a JobLaunching trigger. So the solution seems like an anti-pattern.
Spring Batch Integration - pass data b/w integration and batch
Any help would be greatly appreciated