activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Correlation ID for request/response
Date Thu, 17 May 2007 14:23:59 GMT
On 5/17/07, mjparme <mjparmeley@west.com> wrote:
>
>
>
> On 5/17/07, mjparme <mjparmeley@west.com> wrote:
> >
> > When you are using JMS for request/response and you set the correlation ID
> > on
> > the message does this ID have to be unique for the lifetime of the
> > well-known queue you are sending to or does it only have to be unique for
> > the messages currently in the queue?
>
> It can be any ID at all; whether unique or not. e.g. you could recycle
> the same ID after each conversation terminates if you like; so it only
> needs to be unique among the currently active conversations. Often a
> client creates it to correlate responses on a temporary queue; so it
> can be unique within a single JVM in some circumstances.
>
> Ahh ok, that makes sense.  The correlation ID is only there so the client
> that sent the request knows which response matches which request (assuming
> the client sends multiple requests at a time). The "server side" (i.e. the
> consumer of of the well-known queue) doesn't care about the correlation ID
> it just needs to make sure to send back the correlation ID it received (and
> I do) so the client can correlate responses to requests...

Bingo! :)


> see this all makes
> perfect sense I just had to talk it out:-)

:).

I've tried to describe it here....
http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html

by all means edit that wiki page if you think it could be more clear etc.

-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message