activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Pechorin <ivan.pecho...@gmail.com>
Subject Re: Problems with lingering ActiveMQTempQueue objects
Date Thu, 03 Jun 2010 19:10:17 GMT
> I'm using temporary response queues as per the JMS spec and attaching these
> to the message using setJMSReplyTo(responseQueue). The calling code then
> sits and waits for the response or times out and then closes the connection.

Sorry, did I understand correctly and you create a new temporary queue
per every request?

> I'm
> tempted to rework all this to use a single response topic with message
> selectors using a unique response ID, but I've had performance problems in
> the past with selectors, so I'm hesitant to go that route if there might be
> an obvious solution here that I'm missing.

We use one or few temporary (or even normal) queues, attach them to
requests using setJMSReplyTo(responseQueue) and match replies by
correlation Id. Therefore, a response queue is (re-)used for multiple
requests, normally until connection to ActiveMQ broker is broken for
some reason.

Creation of any queue or topic is a sync request to broker. Creation
of consumer is another sync request to broker. Same for producers and
sessions. So, for optimal performance you should cache all these
objects and reuse them for as many requests as possible.

P.S. Sorry if I misunderstood you and wrote something very obvious and
irrelevant to your problem :)

Best regards, Ivan

Mime
View raw message