Author |
Message
|
adder |
Posted: Wed Apr 12, 2006 8:51 pm Post subject: how to code dynamic reply to queue using C++ |
|
|
Apprentice
Joined: 06 Dec 2005 Posts: 43
|
I will write a application which look like a client, it send request to server, and wait response, what need mention here is in request message, reply to queue need to be set, and this reply to queue is a dynamic queue. my question is,
1. what API should I use to get dynamic queue name, use ImqQueue.dynamicQueueName()?
2. ImqQueue.dynamicQueueName() return a ImqString, how to convert ImqString to a normal string
3. following is code fragment, please check if this usage is write
Code: |
queue.setName("SYSTEM.DEFAULT.MODEL.QUEUE");
queue.setDynamicQueueName("AMQ.*");
queue.open();
queue.dynamicQueueName();
|
|
|
Back to top |
|
 |
adder |
Posted: Thu Apr 13, 2006 1:13 pm Post subject: |
|
|
Apprentice
Joined: 06 Dec 2005 Posts: 43
|
anyone can help me, use which API to get dynamic queue name.
after running following code, I display ql('AMQ*') and find a dynamice queue AMQ443EB75C02500020 created, but I don't know which API can be used to get real name of dynamic queue, I have try cout some queue name I can find in redbook, but only queue.dynamicQueueName() has value, and output is still "AMQ*", thx in advance!
Code: |
queue.setName("SYSTEM.DEFAULT.MODEL.QUEUE");
queue.setDynamicQueueName("AMQ*");
queue.open();
//cout<<"base queue name:"<<this->queue.baseQueueName()<<endl;
//cout<<"resolvedQueueName:"<<this->queue.resolvedQueueName()<<endl;
//cout<<"initiation queue name:"<<this->queue.initiationQueueName()<<endl;
cout<<"dynamicQueueName:"<<this->queue.dynamicQueueName()<<endl;
|
|
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 13, 2006 1:50 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You get a dynamic queue by opening a model queue.
This returns to you the name of the actual queue opened. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
adder |
Posted: Thu Apr 13, 2006 2:31 pm Post subject: |
|
|
Apprentice
Joined: 06 Dec 2005 Posts: 43
|
yes, but I need actual queue name and set it as reply to queue name, but I don't know which method of ImqQueue can be used to get actual queue name. thanks
jefflowrey wrote: |
You get a dynamic queue by opening a model queue.
This returns to you the name of the actual queue opened. |
|
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Apr 13, 2006 3:05 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Open the model q to get the dynamic q name, save that name, and use that name in the request message's MQMD Reply To Queue field. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
adder |
Posted: Thu Apr 13, 2006 3:13 pm Post subject: |
|
|
Apprentice
Joined: 06 Dec 2005 Posts: 43
|
PeterPotkay wrote: |
Open the model q to get the dynamic q name, |
how to get dynamic queue name, this is just I want to ask. please. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Apr 13, 2006 3:17 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I don't know C++.
But I guess it would be just like other OO languages. Create the q object (as in open the model queue).
Then execute a method on the newly created q object that returns the name. I'm sure there is one.
There is a manual for MQ and C++ that probably has the details. Click on the documentation button at the top of this screen to get it. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
adder |
Posted: Thu Apr 13, 2006 3:46 pm Post subject: |
|
|
Apprentice
Joined: 06 Dec 2005 Posts: 43
|
PeterPotkay wrote: |
I don't know C++.
But I guess it would be just like other OO languages. Create the q object (as in open the model queue).
Then execute a method on the newly created q object that returns the name. I'm sure there is one.
There is a manual for MQ and C++ that probably has the details. Click on the documentation button at the top of this screen to get it. |
I have serach redbook "WebSpere MQ Using C++", all queue name related method of ImqQueue is as following, and I also try to print out them, but only dynamicQueueName() can be cout, when cout<<baseQueueName(), program core dump. who can help me any more, thanks
ImqString backoutRequeueName( ); Returns the backout requeue name without any indication of possible errors.
ImqString baseQueueName( ); Returns the base queue name without any indication of possible errors.
ImqString dynamicQueueName( ) const ; Returns a copy of the dynamic queue name.
ImqString initiationQueueName( ); Returns the initiation queue name without any indication of possible errors.
ImqString resolvedQueueName( ) ; Returns the resolved queue name, without any indication of possible errors.
ImqString transmissionQueueName( ); Returns the transmission queue name without any indication of possible errors. |
|
Back to top |
|
 |
adder |
Posted: Thu Apr 13, 2006 4:58 pm Post subject: |
|
|
Apprentice
Joined: 06 Dec 2005 Posts: 43
|
found it, ImqQueue.name() |
|
Back to top |
|
 |
|