Author |
Message
|
fsapienza |
Posted: Tue Dec 06, 2005 2:58 am Post subject: TemporaryQueue |
|
|
Novice
Joined: 11 Nov 2005 Posts: 10
|
Hi all!
In my JMS application I'm using temporary queues, creating them with the instruction
replyQueue = queueSession.createTemporaryQueue();
These queues are deleted automatically at connection closure: is it instead possible to avoid the deletion of these queues, using them like "permanent dynamic queues" ?
I'm using IBM WebSphere Application Server and I can't use MQ objects like MQQueue and similar.
Thanks, ciao |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 4:46 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's no reason to use temporary queues at all.
You can have your MQ admin create real queues, and then you can use plain JMS to access them, without having to resort to the MQ API for Java.
There is no relationship between the API you use and the type of MQ object that you access with that API.
You can have your admin create Queue Destinations in the WebSphere MQ JMS Provider in WAS, and then look those up in JNDI to get a reference to the real queue underneath. You can also have them create a Queue Connection Factory definition in the MQ Provider, and look that up as well. This would be considered the standard way to do this. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fsapienza |
Posted: Tue Dec 06, 2005 5:29 am Post subject: |
|
|
Novice
Joined: 11 Nov 2005 Posts: 10
|
Thanks for your reply.
You suggested me to use real queue: but can an unique queue support 2,000,000 messages/day (my application has this necessity)? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 5:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You won't have any problems. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fsapienza |
Posted: Tue Dec 06, 2005 5:54 am Post subject: |
|
|
Novice
Joined: 11 Nov 2005 Posts: 10
|
I will try with an unique real queue.
Anyway, in an older application with MQ libraries I used these instructions:
iOpenOptionsIn = MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE | MQC.MQOO_SET_IDENTITY_CONTEXT;
oMQQueueOut = oMQQueueManager.accessQueue("MY.NAME.MODEL.QUEUE", iOpenOptionsIn, "QUEUEMANAGERNAME", "MY.NAME.MODEL.QUEUE.1", null);
in order to create queues with names "MY.NAME.MODEL.QUEUE.1", "MY.NAME.MODEL.QUEUE.2", .. etc. etc.
Can you confirm me I won't be able to do something similar with JMS objects? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 6:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think if you use a regular queue destination that points to a model queue, rather than using createTemporaryQueue, then this will work.
What were your original motivations in using a temporary queue in the first place? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Dec 06, 2005 6:15 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Take a look at the TEMPQPREFIX property in the Using Java manual. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 6:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
bower5932 wrote: |
Take a look at the TEMPQPREFIX property in the Using Java manual. |
I knew that was somewhere... it just wasn't where I thought it was. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fsapienza |
Posted: Tue Dec 06, 2005 6:43 am Post subject: |
|
|
Novice
Joined: 11 Nov 2005 Posts: 10
|
You asked me the original motivations in using a temporary queue ...
What I want to do is:
1) Use a specific "MY.NAME.MODEL.QUEUE.xx" for the replies
2a) If queue exists, that's ok.
2b) If queue doesn't exists create it runtime and eventually using it in future.
With JMS I tried to create TemporaryQueue in 2b case, but when connection will be closed the queue is deleted, so I won't be able to use it in future. And it is very heavy to create almost 2,000,000 temporary queues every day ...
About TEMPQPREFIX I have read the Using Java manual, but I can't use MQ objects, and seems to me that only with MQ objects I can use methods to set it. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 06, 2005 6:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
TEMPQPREFIX is an attribute on JMS managed objects. Your websphere admin will be able to set this in the properties of your Queue Destination. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fsapienza |
Posted: Tue Dec 06, 2005 6:57 am Post subject: |
|
|
Novice
Joined: 11 Nov 2005 Posts: 10
|
Sure, but also setting the TEMPQPREFIX in WAS admin console temporary queues will be deleted at the end of connection ... |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 06, 2005 9:22 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It really depends on what you are trying to do.
If you are trying to automate queue creation to save on admin load you should look into support pack MS0B.
The other thing you have to keep in mind is that you should not send a persistent message to a temporary queue.
You do have "durable" temporary queues which survive the session. These are in reallity permanent queues. I would strongly suggest having your MQ admin create permanent queues or using support pack MS0B as you do not want some kind of arbitrary name (i.e. generic name with a bunch of numbers at the end.)
Enjoy  |
|
Back to top |
|
 |
|