You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sic <si...@naver.com> on 2010/07/08 12:32:58 UTC

correlation ID on synchronous message

I give thought to the correlation ID concept on the JMS Specification.

When using synchronous queue messages, we should have JMSReplyTo header
which has a destination of the producer.

After sending, the producer waits for reply message to reach its temporary
queue.

In this format, it is only the consumer of that message that can send the
reply message by JMSReplyTo header.

So it's fine without correlation ID because the producer waits for reply
message not on the static queue but on the temporary queue registered in the
JMSReplyTo header.

And that's all in my thought.

Then, What's the purposes for using the correlation ID?

I have heard that using this is for relating sending message to its reply
message.

But it doesn't need to relate between them unless we using it in the
application layer.

Although it's not about activemq, I try asking because I can't find any
appropriate forum for that issue.

I hope anybody informs me of this concept.

regards,

sic
-- 
View this message in context: http://old.nabble.com/correlation-ID-on-synchronous-message-tp29105526p29105526.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: correlation ID on synchronous message

Posted by Gary Tully <ga...@gmail.com>.
The correlation Id is useful when a reply queue is shared by processes
or by producers/consumers concurrently and the replies come back out
of order.
Typically, a queue is used to decouple 'requests for work' from 'work'
so the order of 'work' completion is not deterministic, hence the need
for a correlationId. If all requests are serialized as in an RPC style
interaction there is no need for the correlation id, but then why use
a MOM at all.

There is some more detail at
http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html

On 8 July 2010 11:32, sic <si...@naver.com> wrote:
>
> I give thought to the correlation ID concept on the JMS Specification.
>
> When using synchronous queue messages, we should have JMSReplyTo header
> which has a destination of the producer.
>
> After sending, the producer waits for reply message to reach its temporary
> queue.
>
> In this format, it is only the consumer of that message that can send the
> reply message by JMSReplyTo header.
>
> So it's fine without correlation ID because the producer waits for reply
> message not on the static queue but on the temporary queue registered in the
> JMSReplyTo header.
>
> And that's all in my thought.
>
> Then, What's the purposes for using the correlation ID?
>
> I have heard that using this is for relating sending message to its reply
> message.
>
> But it doesn't need to relate between them unless we using it in the
> application layer.
>
> Although it's not about activemq, I try asking because I can't find any
> appropriate forum for that issue.
>
> I hope anybody informs me of this concept.
>
> regards,
>
> sic
> --
> View this message in context: http://old.nabble.com/correlation-ID-on-synchronous-message-tp29105526p29105526.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: correlation ID on synchronous message

Posted by sic <si...@naver.com>.
Oh, now I see. 
 
I thought 'synchronous' means that a producer send only one message in order
not to disorder a request.

I also didn't think synchronous producer in MOM can send multiple requests
simultaneously because of misunderstanding the sequence of messages should
be ordered strictly.

Thank you so much for two helpful comments.

sic


Ivan Pechorin wrote:
> 
>> So it's fine without correlation ID because the producer waits for reply
>> message not on the static queue but on the temporary queue registered in
>> the
>> JMSReplyTo header.
> 
> It's fine without correlation ID as long as the requesting side
> (producer) waits for reply before sending next request.
> Correlation ID allows to avoid this limitation: the requesting side
> can send multiple requests, then wait for the replies and match these
> using correlation ID.
> 
> 

-- 
View this message in context: http://old.nabble.com/correlation-ID-on-synchronous-message-tp29105526p29170659.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: correlation ID on synchronous message

Posted by Ivan Pechorin <iv...@gmail.com>.
> So it's fine without correlation ID because the producer waits for reply
> message not on the static queue but on the temporary queue registered in the
> JMSReplyTo header.

It's fine without correlation ID as long as the requesting side
(producer) waits for reply before sending next request.
Correlation ID allows to avoid this limitation: the requesting side
can send multiple requests, then wait for the replies and match these
using correlation ID.