Is there any API support for doing RPC style communication with the new packages. I would like to send a message to a queue and then wait for a response for that message until I can continue further processing. I could always set a reply-to attribute in the header and create a listener to listen to a default queue right after i send a message to mock this, however i was wondering if the api provides something by default. I couldn't find anything glaringly obvious after scanning the API's.
We are in the process of adding this functionality (post-M1).
Here's the issue:
If you grab the trunk version, you can use the 'convertSendAndReceive()' method on the RabbitTemplate.
It also works with the MessageConverters. So you can just pass an Object and receive an Object:
Try it out if you have a chance... looking forward to some feedback.
someReplyObject = template.convertSendAndReceive(someRequestObject)
whats the location for the snapshot repo and is the version 1.0.0.BUILD-SNAPSHOT and whats the timeline for it to make it to a milestone release. Maven will not let us go into production with a snapshot dependency.
Thanks, I'll give it a shot and see how it works.
Yes, the version is 1.0.0.BUILD-SNAPSHOT, and here is the repository info (taken from our 'helloworld' sample's pom.xml):
Hope that helps.
<name>Spring Framework Maven Snapshot Repository</name>
While trying to integrate this method convertSendAndReceive I found a few shortcomings. Since the method only takes the object as an argument this requires me to set the exchange name, routing key and message converter on the amqp template object. However I would not like to do that since I use the same template to send to different exchanges/queues using one or more converters. Is there a plan to have a detailed method like the send method that takes a exchange name, routing key, and message Creator object as a parameter?
We will be adding more 'convertAndSend' methods. We have been discussing the fact that there is such a proliferation of methods because of the 'exchange' and 'routingKey' (while JmsTemplate for example only has Destination). We do also have an Address class that uses conventions for its String value (e.g. "exchangeType://exchangeName/routingKey").
I guess now is a good time to ask the community how you would feel about using the Address object as opposed to or in addition to the version that would take 2 separate String args (for 'exchangeName' and 'routingKey').
In any case, we will address this in time for the M2 release. Feel free to comment on the JIRA issue as well: https://jira.springsource.org/browse/AMQP-19