ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » TemporaryQueue

Post new topic  Reply to topic
 TemporaryQueue « View previous topic :: View next topic » 
Author Message
fsapienza
PostPosted: Tue Dec 06, 2005 2:58 am    Post subject: TemporaryQueue Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 06, 2005 4:46 am    Post subject: Reply with quote

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
View user's profile Send private message
fsapienza
PostPosted: Tue Dec 06, 2005 5:29 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 06, 2005 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message
fsapienza
PostPosted: Tue Dec 06, 2005 5:54 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 06, 2005 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Tue Dec 06, 2005 6:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Tue Dec 06, 2005 6:23 am    Post subject: Reply with quote

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
View user's profile Send private message
fsapienza
PostPosted: Tue Dec 06, 2005 6:43 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 06, 2005 6:52 am    Post subject: Reply with quote

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
View user's profile Send private message
fsapienza
PostPosted: Tue Dec 06, 2005 6:57 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 06, 2005 9:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » TemporaryQueue
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.