Author |
Message
|
mqnivas |
Posted: Thu Aug 01, 2002 8:35 pm Post subject: Use of CorrelID... |
|
|
Newbie
Joined: 01 Aug 2002 Posts: 7
|
Hi All,
I just would like to understand the various use og CorrelID, so that I can make best use of it in my project.
Also tell me the difference between the CorrelID and ApplicationID.
Thanks in Advance,
Vasu |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Aug 02, 2002 10:10 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The CorrelId is a field that your application can use to relate one message to another. The most common use of it that I've seen is to have one program send a request to another with a specific MsgId. The receiving program builds a reply and then sends it back with the orignator's MsgId copied to the CorrelId of the reply.
I'm not sure what the ApplicationId field is. Are you sure you've got the right name? |
|
Back to top |
|
 |
mqnivas |
Posted: Fri Aug 02, 2002 9:09 pm Post subject: |
|
|
Newbie
Joined: 01 Aug 2002 Posts: 7
|
Hi,
Thanks for the reply. I tried , setting my customized value the CorrelId in my put application prog. As shown below,
byte b[] = "My Value".getBytes();
msg.correlationId = b;
I have also used the option as
int iReport = MQC.MQRO_COA_WITH_DATA | MQC.MQRO_COD_WITH_DATA | MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID;
From get application when I get the message I am not getting the value set for the CorrelId. This I want to do to match the message using CorrelId. Am I going wrong somewhere or missing out something.
Please do suggest.
Thanks,
Vasu |
|
Back to top |
|
 |
bduncan |
Posted: Sat Aug 03, 2002 7:57 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Vasu,
When you use the MQRO_COPY_MSG_ID_TO_CORREL_ID, you are basically telling the queue manager to take whatever value is assigned to the MsgId field and assign it to the CorrelId field as well, overwriting the CorrelId you just set. You should notice on the receiving end that the MsgId and CorrelId are now the same, and that is why your MQGET is failing because you are trying to retrieve a message with CorrelId "My Value" which doesn't exist. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
mqnivas |
Posted: Sun Aug 04, 2002 11:02 pm Post subject: Thanks for the explantion... |
|
|
Newbie
Joined: 01 Aug 2002 Posts: 7
|
bduncan,
Thanks for the explantion, now I understood where I went wrong. My prog is working fine now.
Thank you very much once again.
I need one more clarification regerding the MQ trigger. To use this what I should set, if you tell me the link from where I get this information I will try out.
I also heard of the name, Initiation Queue,Trigger monitor, process name.
will you give me some idea on this and how to configure those.
Thanks,
Vasu. |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Aug 05, 2002 9:09 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
There is an entire chapter in the Application Programming Guide on triggering. You might want to read it over and see what kind of questions it does/doesn't answer for you. |
|
Back to top |
|
 |
bduncan |
Posted: Mon Aug 05, 2002 11:16 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Bower is right... Triggering is too complex a concept to explain in a few sentences... You should read the entire chapter in order to understand it fully... _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
poki |
Posted: Mon Aug 05, 2002 1:42 pm Post subject: Trigger monitor |
|
|
 Newbie
Joined: 05 Aug 2002 Posts: 9 Location: US
|
Perhaps this can help to some extent..(For better understanding go thr the code provided by MQ for trigger monitor).
1. Application A, which can be either local or remote to the queue manager, puts a message on the application queue. Note that no application has this queue open for input. However, this fact is relevant only to trigger type FIRST and DEPTH.
2. The queue manager checks to see if the conditions are met under which it has to generate a trigger event. They are, and a trigger event is generated. Information held within the associated process definition object is used when creating the trigger message.
3. The queue manager creates a trigger message and puts it on the initiation queue associated with this application queue, but only if an application (trigger monitor) has the initiation queue open for input.
4. The trigger monitor retrieves the trigger message from the initiation queue.
5. The trigger monitor issues a command to start application B (the server application).
Application B opens the application queue and retrieves the message. |
|
Back to top |
|
 |
|