Reputation: 97
Is there a way to using the sendAndRecieve()
method from the RabbitTemplate
and use the non-default exchange. I know I can use the setReplyQueue()
method but that is limited to the default exchange.
Right now the only way I get around this is by manually passing the reply-to
when building the message, and send synchronously and receive afterwards.
Thanks in advance, hopefully its just an oversight of mine.
Upvotes: 2
Views: 403
Reputation: 174574
Please open an Improvement JIRA Issue.
The listener supports a replyTo
with the form exchange/routingKey
- see the documentation.
However, the rabbit Template doesn't support setting it up that way for send and receive operations, it sets up reply routing using the default exchange and queue name as the rk.
Unfortunately, I don't see an easy work around.
EDIT: removed my suggested workaround - it won't work because the method references private fields.
EDIT2: I found another work-around by configuring the template with Java instead of XML...
https://github.com/garyrussell/spring-amqp/commit/47d8238fd8651ed3a04eab7c91fae632c7f3155c
Upvotes: 2