I'm trying to create a Request/Reply flow with Spring Integration Java DSL that's described as such:
IntegrationFlows.from(directChannel)
.handle(Jms.outboundGateway(connectionFactory)
.requestDestination(requestDestination)
.replyDestination(replyDestination))
.handle(replyHandler)
.get();
If I kill my application that supposed to handle the reply, then the reply gets left on the queue and isn't consumed the next time the application starts up. When I send follow up requests with this flow, the previous message is received and not the latest reply.
The message flow I'm testing looks like
App A sends message -> Stop A -> App B receives message and sends reply R1
A starts up -> A sends another message -> B receives message and sends reply R2 -> A receives R1
R2 is left on the queue
Am I doing something wrong?
Thanks!