You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by khandelwalanuj <kh...@gmail.com> on 2013/12/20 17:26:41 UTC

Request-Response in ActiveMQ

Hi,

I want to implement request-response using JMS. I found two ways of doing
it:

1. Using selectors
2. Filter duplicate messages in producer application itself.

Which method is recommended by ActiveMQ vendors ? 
What is the performance overhead on broker in case of selectors , because I
think broker has to do filtering for each message ? Does it reduce the
performance by big amount ?

Thanks,
Anuj 



--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-Response-in-ActiveMQ-tp4675769.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Request-Response in ActiveMQ

Posted by Joacim <4i...@gmail.com>.
Hi,

At work we use another JMS provider but think the approach is the same. We 
use two different Request/Response patterns; Synchronous and Asynchronous.
When using synchronous we normally try to receive the response with selector 
on JMSCorrelationId and have a timeout.
When using asynchronous we normally have a listener active the receives all 
responses and then in the application correlate on JMSCorrelationId (or 
something relevant in the payload).

/ Joacim


-----Original Message----- 
From: khandelwalanuj
Sent: Friday, December 20, 2013 5:26 PM
To: users@activemq.apache.org
Subject: Request-Response in ActiveMQ

Hi,

I want to implement request-response using JMS. I found two ways of doing
it:

1. Using selectors
2. Filter duplicate messages in producer application itself.

Which method is recommended by ActiveMQ vendors ?
What is the performance overhead on broker in case of selectors , because I
think broker has to do filtering for each message ? Does it reduce the
performance by big amount ?

Thanks,
Anuj



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Request-Response-in-ActiveMQ-tp4675769.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com. 


Re: Request-Response in ActiveMQ

Posted by khandelwalanuj <kh...@gmail.com>.
Please respond...



--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-Response-in-ActiveMQ-tp4675769p4675813.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Request-Response in ActiveMQ

Posted by artnaseef <ar...@artnaseef.com>.
It's also possible to use temporary destionations for request/reply.  Have
the requestor create a temporary queue and set that as the JMSReplyTo of the
message before sending to the server that will send back the reply.  Then
the server replies to the JMSReplyTo address on the message.

When using this solution, be careful to avoid creating and destroying temp
destinations rapidly.  The right way to use a temporary destination in this
case is to create one when the requestor creates the JMS connection, then
reuse that destination.

Selector overhead is a real concern.  It has been recommended strongly to me
by experts to avoid using selectors as they notably impact overall broker
performance.

If your architecture works to use a requestor-specific queue (not a
temporary queue) then that's a great way to go as it avoids race conditions
and other potential issues with temporary destinations.

Under the hood, if I understand correctly, Camel uses temporary destinations
to implement request/reply with JMS.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-Response-in-ActiveMQ-tp4675769p4676066.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Request-Response in ActiveMQ

Posted by khandelwalanuj <kh...@gmail.com>.
Using Synchronous communication what is the overhead on broker using
selectors ? 
Please respond.

Thanks,
Anuj



--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-Response-in-ActiveMQ-tp4675769p4676033.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Request-Response in ActiveMQ

Posted by cjiang <ch...@xirrus.com>.
We use Apache camel with activemq, in which there is reply-response pattern
built in. Please check this url: http://camel.apache.org/request-reply.html




--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-Response-in-ActiveMQ-tp4675769p4676051.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.