[rabbitmq-discuss] synchronized messages: through the queue and multiple consumers

joe lee codewalkerjoe at gmail.com
Tue Jan 22 12:09:59 GMT 2008


Martin,

Qpid python or RabbitMQ java client compatible with OpenAMQ?  I must say, I
am impressed with the documentation.  Very nice.  I am downloading as of now
and will give it a try.

Thanks,
joe



On Jan 17, 2008 7:08 AM, Martin Sustrik <sustrik at imatix.com> wrote:

> Hi,
>
> We have a detailed article about implementing this kind of stuff over
> AMQP here:
>
> http://wiki.openamq.org/tutorial:soa
>
> It's not RabbitMQ, but as both products use AMQP, the solution should be
> almost identical.
>
> Martin
>
> Tony Garnock-Jones wrote:
> > Hi Joe,
> >
> > joe lee wrote:
> >
> >> I have two producers that need to send synchronized message to a queue,
> >> where 1 of 3 consumers will consume the message.  In this scenario,
> >> would the producer who sent the message, waits for the status back from
> >> the consumer, that consumed the message?
> >>
> >
> > There's no provision for this kind of synchronisation embedded in AMQP,
> > but it's the kind of thing that's easy to construct on top of AMQP.
> >
> >
> >> In synchronized messaging,
> >> would producer and consumer talk directly to each other or the message
> >> put in queue and consumer consume and reply back to the waiting
> producer?
> >>
> >
> > The latter - every communication is mediated by a queue.
> >
> > One way you could get what I think you're after would be to have a setup
> > like the following diagram, where consumers get handed work items
> > round-robin from the queue, and each item has a queue name in the
> > "reply-to" field of the Basic Properties content header. When the
> > consumer finishes the job, it replies to the producer by inserting a
> > message in the reply queue found in the request, with the reply's
> > "correlation-id" field set equal to the "correlation-id" field of the
> > request. See, for example, classes RpcClient and RpcServer in the main
> > RabbitMQ java client library.
> >
> >
> >       Producer   -----------------------\
> >           ^                              \
> >           |                               \
> >                                            |
> >               Producer's                           |
> >               reply                                |
> >               queue                                v
> >
> >           ^                           Service exchange
> >           |
> >           |
> >           |                                |
> >           |                                |
> >           |                                v
> >           |
> >           |                         Service queue
> >           |
> >           |                                |
> >           |                                |
> >           |                                v
> >           |                                |
> >           |                         /------+------\
> >           |                        /       |       \
> >           |                       |        |        |
> >           |                       |        |        |
> >           |                       |        |        |
> >           |                       v        v        v
> >           |
> >           |            Consumers: 1        2        3
> >           |
> >            \                                        |
> >             \                                       /
> >              \--------------------------------------
> >
> >
> > Regards,
> >   Tony
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080122/696abd33/attachment.htm 


More information about the rabbitmq-discuss mailing list