You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by PhilBurress <nm...@amig.com> on 2013/04/02 20:01:27 UTC

Deleting MQ Temporary Queue

Our application is using MQ temporary dynamic queues for our replyTo queue in
a request/reply pattern. It works fine and is very fast, except the
temporary queues do not get deleted at the end of the transaction; only when
the application server is shut down. Is there a hook somewhere in Camel
where we can issue the delete queue call at the end of a transaction?



--
View this message in context: http://camel.465427.n5.nabble.com/Deleting-MQ-Temporary-Queue-tp5730231.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Deleting MQ Temporary Queue

Posted by Magnus Palmér <ma...@gmail.com>.
For WMQ the temporary queues gets deleted when the connection to the
queuemanager ends since no explicit call to TemporaryQueue.delete() is
made, from the WMQ infocenter:

*Although a session is used to create a temporary queue, the scope of a
temporary queue is the connection that was used to create the session. Any
of the connection’s sessions can create message producers and message
consumers for the temporary queue. The temporary queue remains until the
connection ends or the application explicitly deletes the temporary queue
by using the TemporaryQueue.delete() method, whichever is the sooner.*
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaw.doc/jm25070_.htm
*
*

By default I believe it is
the org.apache.camel.component.jms.reply.TemporaryQueueReplyManager that
gets created for handling the replies.
And looking into it you can (contrary to what the camel-jms docs says) set
the replyToCacheLevelName=CACHE_NONE instead, not sure it will help you
though.
>From the code:
 // we use CACHE_CONSUMER by default to cling to the consumer as long as we
can, since we can only consume
        // msgs from the JMS Connection that created the temp destination
in the first place
        if (endpoint.getReplyToCacheLevelName() != null) {
            answer.setCacheLevelName(endpoint.getReplyToCacheLevelName());
        } else {

answer.setCacheLevel(DefaultMessageListenerContainer.CACHE_CONSUMER);
        }




2013/4/3 PhilBurress <nm...@amig.com>

> For MQ we had to create a temporary dynamic model queue, which is specified
> in the queue connection factory. Example from one of our integration tests:
>
> ... and in the route...
>
> So it uses the same model queue each time. It appears that Camel will
> attempt to reuse the temporary queues it creates and it only creates
> additional temporary queues as needed (under load). The queues do
> eventually
> get deleted when the application shuts down, but I think we're looking for
> something which will actively poll for unused temporary queues and remove
> them as appropriate.
>
> We are using Camel 2.10.1 with MQ version 7.0.x
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Deleting-MQ-Temporary-Queue-tp5730231p5730290.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Brgds, Magnus Palmér
+46736845680

Re: Deleting MQ Temporary Queue

Posted by PhilBurress <nm...@amig.com>.
For MQ we had to create a temporary dynamic model queue, which is specified
in the queue connection factory. Example from one of our integration tests:

... and in the route...

So it uses the same model queue each time. It appears that Camel will
attempt to reuse the temporary queues it creates and it only creates
additional temporary queues as needed (under load). The queues do eventually
get deleted when the application shuts down, but I think we're looking for
something which will actively poll for unused temporary queues and remove
them as appropriate.

We are using Camel 2.10.1 with MQ version 7.0.x



--
View this message in context: http://camel.465427.n5.nabble.com/Deleting-MQ-Temporary-Queue-tp5730231p5730290.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Deleting MQ Temporary Queue

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Apr 2, 2013 at 8:01 PM, PhilBurress <nm...@amig.com> wrote:
> Our application is using MQ temporary dynamic queues for our replyTo queue in
> a request/reply pattern. It works fine and is very fast, except the
> temporary queues do not get deleted at the end of the transaction; only when
> the application server is shut down. Is there a hook somewhere in Camel
> where we can issue the delete queue call at the end of a transaction?
>

No there is no such option.

Maybe MQ has some option to automatic delete temp queues which are no
longer in use.
ActiveMQ can do that.

Can you tell a little more about your configuration. Are you use a
different temp queue name per request/reply message. Or reuse the same
temp queue name for the lifetime of the Camel route?

We could possible add some option to instruct Camel to attempt to
delete the queue when you stop the route?
But would be good to hear a bit more about your setup.

And if you run for a while, how many temp queues do you have on MQ?

And what versions of Camel and MQ are you using?

>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Deleting-MQ-Temporary-Queue-tp5730231.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen