Sep 19th, 2012, 10:58 AM
Replacing Spring AMQP Request-Reply With Spring Integration
All, I have a working application that currently uses Spring AMQP. When handling requests from the web tier, we use AMQP Template's sendAndReceive method which takes care of creating a temporary response queue and blocking for the response message to come back from RabbitMQ. I tried to replace the consumer side with Spring Integration using an InboundAdaper and InboundGateway (I tried both because it wasn't working properly for me and was experimenting). In both cases, the message was being properly pulled off the queue and handled. The issue was that Spring Integration would complain that no return channel was being provided -- the method processing the message returned a string. When I examined the incoming headers, I see that the AMQP reply-to property contains a valid value -- the temporary queue that the AMQP Template set up. Is this a supported scenario? Is Spring Integration supposed see the AMQP reply-to value can create some sort of dynamic channel? I tried configuring the AMQP Template so that instead of creating a temporary queue, it used a specific one and I bound my outbound channel to that queue. No dice. Still got the complaint about not having a reply channel. I'd love to let Spring Integration do some of the heavy lifting for me but I can't switch until I get request-reply to work properly. Any insight is appreciated.
Tags for this Thread