Announcement Announcement Module
Collapse
No announcement yet.
RPC Communication Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RPC Communication

    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.

    Thanks
    Irfan

  • #2
    We are in the process of adding this functionality (post-M1).

    Here's the issue:
    https://jira.springsource.org/browse/AMQP-19

    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:
    Code:
    someReplyObject = template.convertSendAndReceive(someRequestObject)
    Try it out if you have a chance... looking forward to some feedback.

    Thanks,
    Mark

    Comment


    • #3
      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.

      Comment


      • #4
        Yes, the version is 1.0.0.BUILD-SNAPSHOT, and here is the repository info (taken from our 'helloworld' sample's pom.xml):

        Code:
        <repository>
            <id>repository.springframework.maven.snapshot</id>
            <name>Spring Framework Maven Snapshot Repository</name>
            <url>http://maven.springframework.org/snapshot</url>
        </repository>
        Hope that helps.
        -Mark

        Comment


        • #5
          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?

          Thanks
          Irfan

          Comment


          • #6
            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

            Thanks,
            Mark

            Comment

            Working...
            X