Author |
Message
|
kayoumt |
Posted: Thu Jun 04, 2009 7:49 pm Post subject: XMS - Temporary Dynamic Queue |
|
|
Voyager
Joined: 18 Sep 2007 Posts: 81
|
Hi,
Could someone tell me how could I create temporary dynamic queues (with queue name) ? Otherwise, how I could make a persistent queue automatically destroy when application is stopped ?
Thanks in advance for any help. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jun 04, 2009 8:10 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
the using manual under QModel and JMS setup for the QCF / connection factory  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kayoumt |
Posted: Fri Jun 05, 2009 4:51 am Post subject: |
|
|
Voyager
Joined: 18 Sep 2007 Posts: 81
|
Please, No more polution, fjb_saper !!! If you do not understand my question or cannot answer, don't send me that kind of posts.
-- Back to my question --
I know how to create dynamic temporary queues with MQ API of any language, by using queue models. I'm trying to do the same thing with XMS (JMS) !!!
I know that there's a method called Session.createTemporaryQueue. But, the queues that method creates does not have a name. Without a chosen name, I do not see how a remote application could send messages in that queue. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 05, 2009 5:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kayoumt wrote: |
Please, No more polution, fjb_saper !!! If you do not understand my question or cannot answer, don't send me that kind of posts.
|
And if you don't like the answer, don't send that kind of response and increase the polution.
kayoumt wrote: |
I know how to create dynamic temporary queues with MQ API of any language, by using queue models.
...
Without a chosen name, I do not see how a remote application could send messages in that queue. |
These 2 statements seem inconsistent. TempDyn queues never have a chosen name no matter how (or through what API) they've been created. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jun 05, 2009 5:34 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
You can choose the name of a Dynamic Queue.
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/fg12280_.htm
Quote: |
You can specify the name of the dynamic queue that you create in three ways:
***Give the full name that you want in the DynamicQName field of the MQOD structure.
***Specify a prefix (fewer than 33 characters) for the name, and allow the queue manager to generate the rest of the name. This means that the queue manager generates a unique name, but you still have some control (for example, you might want each user to use a certain prefix, or you might want to give a special security classification to queues with a certain prefix in their name). To use this method, specify an asterisk (*) for the last non-blank character of the DynamicQName field. Do not specify a single asterisk (*) for the dynamic queue name.
***Allow the queue manager to generate the full name. To use this method, specify an asterisk (*) in the first character position of the DynamicQName field.
For more information about these methods, see the description of the DynamicQName field in the Application Programming Reference.
|
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 05, 2009 5:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PeterPotkay wrote: |
You can choose the name of a Dynamic Queue.
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/fg12280_.htm
Quote: |
You can specify the name of the dynamic queue that you create in three ways:
***Give the full name that you want in the DynamicQName field of the MQOD structure.
***Specify a prefix (fewer than 33 characters) for the name, and allow the queue manager to generate the rest of the name. This means that the queue manager generates a unique name, but you still have some control (for example, you might want each user to use a certain prefix, or you might want to give a special security classification to queues with a certain prefix in their name). To use this method, specify an asterisk (*) for the last non-blank character of the DynamicQName field. Do not specify a single asterisk (*) for the dynamic queue name.
***Allow the queue manager to generate the full name. To use this method, specify an asterisk (*) in the first character position of the DynamicQName field.
For more information about these methods, see the description of the DynamicQName field in the Application Programming Reference.
|
|
My sig receives further affirmation!
You know I've never done that? Ever? Never specified a name on TempDyn?
New trick to be experimented with shortly....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jun 05, 2009 5:38 am Post subject: Re: XMS - Temporary Dynamic Queue |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
kayoumt wrote: |
Otherwise, how I could make a persistent queue automatically destroy when application is stopped ?
|
You cannot. Well, I suppose your could write a second utility program with MQ admin access which just sits there watching your first program, waiting for it to end, so that it could issue the delete q command.
Read this section:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/fg11010_.htm _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 05, 2009 5:45 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
In general, one expects that Dynamic queues are used as Reply To Queues, and as such it never really matters *what* the name is, as long as the Request message properly includes it.
Outside of a Reply To Queue Name, or a static configuration, I'm not sure how a remote application can know the name of *any* queue, and a temporary queue is twice as confusing in that respect. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 05, 2009 5:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
In general, one expects that Dynamic queues are used as Reply To Queues, and as such it never really matters *what* the name is, as long as the Request message properly includes it. |
Kinda how I've been using them
mqjeff wrote: |
Outside of a Reply To Queue Name, or a static configuration, I'm not sure how a remote application can know the name of *any* queue, and a temporary queue is twice as confusing in that respect. |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shashikanth_in |
Posted: Fri Jun 05, 2009 9:38 am Post subject: |
|
|
Centurion
Joined: 26 Feb 2009 Posts: 123
|
kayoumt wrote: |
Please, No more polution, fjb_saper !!! If you do not understand my question or cannot answer, don't send me that kind of posts.
-- Back to my question --
I know how to create dynamic temporary queues with MQ API of any language, by using queue models. I'm trying to do the same thing with XMS (JMS) !!!
I know that there's a method called Session.createTemporaryQueue. But, the queues that method creates does not have a name. Without a chosen name, I do not see how a remote application could send messages in that queue. |
Session.createQueue returns destination object. You can use the destination method "getName" to retrieve the temporary queue name and pass the same as replyTo queue.
But as others have said, it's best to use the requestor if you are expecting response from remote application. Requestor does all the job for you.
Another point: You can also directly use the destination returned by Session.createQueue to set JMSReplyTo property. |
|
Back to top |
|
 |
kayoumt |
Posted: Fri Jun 05, 2009 11:40 am Post subject: |
|
|
Voyager
Joined: 18 Sep 2007 Posts: 81
|
I'm back.
I was in meeting since a couple of hours.
shashikanth_in
Session.createQueue does not seem to return a temporary queue. I'm not sure that created queue will not persist after the process (application) which created it stops.
Vitor, mqjeff, PeterPotkay
I did already intensive use of temporary dynamic queues (mainly in real time systems). That kind of queues are very suitable for messages which will not be relevant after the application stops and restarts :
- Reply queues
- Real Time Publishes (real time events)
- Any kind of queue that the name (and data) will be relevant after the application stops and restarts.
In a point-to-point communication by queues, an application always needs to know the name of the remote queue (of the remote application) for sending a message to the remote application via that queue.
Example :
- If you do publish/subscribe with RFH. The subscribing application always need to specify its data queue to broker. That queue is generally composed by a name identifying that application. Then, the broker will understand that if it finds publishes matching that subscribe, it has to send message in susbscriber's data queue.
- If, also, an application (client) sends a request to a remote application (server), the client could specify to the server an unique queue name for getting answers.
These two kinds of queues are good candidates for Dynamic Temporay Queues (in Real Time Systems).
According to Mr Google
"There are three ways to specify the name of the dynamic queue you create:"
http://middleware.its.state.nc.us/middleware/Documentation/en_US/htm/csqzal06/csqzal061y.htm#HDRWRKDYNQ
What I'm trying to find out is how to do something like that by XMS ? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 05, 2009 12:20 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Never trust any documentation that is served off of middleware.its.state.nc.us. It's obsolete.
According to the Documentation for the XMS for C/CPlusPlus SupportPac for version 7, at least, you can specify the XMSC_WPM_TEMP_Q_PREFIX property to specify the equivalent component of the dynamic queue name you would use when creating a dynamic queue otherwise.
That may not be valid for XMS for .NET. But you've failed to specify.
And you've also apparently failed to check the relevant XMS doc yourself, since I found that property in about two minutes. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 05, 2009 1:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Never trust any documentation that is served off of middleware.its.state.nc.us. It's obsolete. |
We can only hope the Office of Information Technology Services does a better job for the State Govt of North Carolina than it does here... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kayoumt |
Posted: Fri Jun 05, 2009 1:41 pm Post subject: |
|
|
Voyager
Joined: 18 Sep 2007 Posts: 81
|
mqjeff,
It is not only the number of googling minutes which determine the toughness of finding information ; you have to consider also the number of results retiurned by Google.
I typed "XMSC_WPM_TEMP_Q_PREFIX" on google and found 3 or 4 results. That explains that you don't have a bulk of links on that topic. Thanks anyway for that information. The prefix is limited to 12 characters maximum prefix !!! Too limited for having significative queue names. I'll try it, anyway, for C++ and C# .NET
I was thinking to use a "classical" API for creating my "old-style" temporary dynamic queues and use XMS for other stuff. But this supposes to use two kinds of APIs (XMS and classical MQ API) in the same application. I'm not sure that mix will be safe. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 05, 2009 1:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kayoumt wrote: |
It is not only the number of googling minutes which determine the toughness of finding information ; you have to consider also the number of results retiurned by Google.
|
Why use Google when you know where to start looking? And can hence find results more quickly? Especially when Mr Google is sabotaged by the only thing the ITS can apparently do well; the Google Dance. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|