Spring AMQP
  1. Spring AMQP
  2. AMQP-19

add sync request/reply methods to AmqpTemplate and RabbitTemplate

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 1.0.0.M3
    • Component/s: Core
    • Labels:
      None

      Activity

      Hide
      Mark Fisher added a comment -

      Moving to M2. We need to think about 2 things (at least):

      1. method naming: I'm thinking of something like WebServiceTemplate with 'marshalSendAndReceive' as well as 'sendAndReceive' with request+reply callbacks.

      2. handling both provided arg for replyTo Address and another method that would generate a temporary one on the fly. With RabbitMQ, we can generate a Queue on the Channel directly, but for other implementations that functionality might be available on the AmqpAdmin implementation only... but we probably don't want to depend on AmqpAdmin impls from AmqpTemplate impls.

      Show
      Mark Fisher added a comment - Moving to M2. We need to think about 2 things (at least): 1. method naming: I'm thinking of something like WebServiceTemplate with 'marshalSendAndReceive' as well as 'sendAndReceive' with request+reply callbacks. 2. handling both provided arg for replyTo Address and another method that would generate a temporary one on the fly. With RabbitMQ, we can generate a Queue on the Channel directly, but for other implementations that functionality might be available on the AmqpAdmin implementation only... but we probably don't want to depend on AmqpAdmin impls from AmqpTemplate impls.
      Hide
      Mark Fisher added a comment -

      The convertSendAndReceive(Object) method has been implemented. It creates a temporary Queue and registers a Consumer with it.

      The challenge with any method that accepts a replyTo Address instance (or a Message that already has a valid replyTo Address property value) is that we would need to ensure that we control the consumer on that Queue and then rely on CorrelationId mapping to a handoff (e.g. a SynchronousQueue).

      Show
      Mark Fisher added a comment - The convertSendAndReceive(Object) method has been implemented. It creates a temporary Queue and registers a Consumer with it. The challenge with any method that accepts a replyTo Address instance (or a Message that already has a valid replyTo Address property value) is that we would need to ensure that we control the consumer on that Queue and then rely on CorrelationId mapping to a handoff (e.g. a SynchronousQueue).
      Hide
      Irfan added a comment -

      I like the idea of having a method that takes an Address argument.

      Show
      Irfan added a comment - I like the idea of having a method that takes an Address argument.
      Hide
      Dave Syer added a comment -

      I agree with Mark. If you are going to set the reply address then you can't expect to get the reply yourself - someone else will receive it (or you can do it yourself manually). That would imply that sendAndReceive() should reject messages with replyTo=<anything> (irrelevant if we are only passing in the payload to convertSendAndReceive()).

      Show
      Dave Syer added a comment - I agree with Mark. If you are going to set the reply address then you can't expect to get the reply yourself - someone else will receive it (or you can do it yourself manually). That would imply that sendAndReceive() should reject messages with replyTo=<anything> (irrelevant if we are only passing in the payload to convertSendAndReceive()).

        People

        • Assignee:
          Mark Fisher
          Reporter:
          Mark Fisher
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: