[openamq-dev] reply_to and routing key
Mike Owens
mikeowens at gmail.com
Sun Nov 4 19:31:17 CET 2007
Great. That's what I was doing.
Again, I really would just like to say how impressed I am with this
software. Without trying to sound too ingratiating, one of the other
benefits I see in this software is the incredible design and experience that
has gone into it. I've been a pretty heavy user of APR for a few years now,
and I've also been quite a fan of writing my own code generators. I am
actually looking forward to learning how to use OpenAMQ's approach to code
generation. I kind of laughed when I read about the evolutionary stages of
code generation on the website and saw where I was in the great chain of
being (apparently not quite walking upright). I really think openamq/amq is
going to fundamentally change how I develop software and what my software
can do. I still can't believe I've managed to overlook this for so long.
Thanks again,
Mike
On 11/4/07, Martin Lucina <mato at imatix.com> wrote:
>
> Mike,
>
> mikeowens at gmail.com said:
> > My question is: how does the application server obtain the client's
> > routing_key -- which in this model seems to be the sole requirement in
> > getting the response back. I am not sure if this is an API or protocol
> > [...]
> > property, or in the content body itself). I guess in STMP, the FROM
> > address must be specified by the sender, so perhaps it makes sense
> > that the producer must specifically supply this information as well.
> > [...]
> > It just seems that the protocol would somehow carry the producer's
> > routing_key information in the message somewhere. As I said, I have
> > this working now by making the client include its routing_key in the
> > reply_to property of the content it sends to the server. That is how
> > the server can direct its response back to the client. I just wasn't
> > sure if there was a more proper/elegant way to do this.
>
> Your reasoning is correct. The content reply-to property is the only
> method a service can use to determine the sender of the message. It's
> also the standard way to do this, since you can follow reply_to when
> e.g. debugging the client/server with a non-zero trace level (-t X).
>
> It is up to the application to set this when creating the content.
>
> Generally speaking, in a simple client/server scenario, what you will
> want to do on the client side is this:
>
> 1) Issue a queue.declare (ticket=0, queue="", passive=0, durable=0,
> exclusive=0, auto_delete=1, nowait=0,
> arguments="")
>
> (You might want exclusive=1 as well)
>
> 2) Save the value of s_session->queue. This will be something like
> "#1", and is the unique routing key for your client's queue.
>
> 3) When creating content, call
>
> amq_content_basic_set_reply_to (basic_content, <saved queue name>);
>
> Hope this answers your question.
>
> -mato
>
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openamq.org/pipermail/openamq-dev/attachments/20071104/30a9318e/attachment.htm
More information about the openamq-dev
mailing list