Author |
Message
|
Nagashree |
Posted: Wed Jan 05, 2005 2:55 am Post subject: MQ triggering |
|
|
Newbie
Joined: 05 Jan 2005 Posts: 2
|
Hi,
Is it mandatory to have a process defined for a triggered queue?
Is there any way by which I can pass the trigger message read by the trigger monitor from the initiation queue to the application that has to be triggered? If so how can this be done?
The MQ Appl prgming guide says "Trigger messages generated by the queue manager are not persistent. This has the
effect of reducing logging (thereby improving performance)"
Is it possible that the trigger message be left in the initiation queue(may not be persistent) instead of being consumed by the trigger monitor?
I am not able to see any messages in my initiation queue since it gets consumed by the trigger monitor. |
|
Back to top |
|
 |
mqmhr |
Posted: Wed Jan 05, 2005 3:06 am Post subject: |
|
|
Centurion
Joined: 28 Dec 2004 Posts: 105
|
You can use the "TriggerData" property of the queue. The value for this property is set dynamically from the application putting the message into the trigger queue. This value is populated into the trigger message which is put into the initiation queue. You could program your trigger monitor to get this value from the trigger message and use it in any way.
Messages placed in the initiation queue are meant to be consumed by the trigger monitor. Why is the purpose of a message in the initiation queue if it is not be used by the trigger monitor? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jan 05, 2005 5:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The information contained in the trigger message IS passed to the triggered application, in the first command line argument as a string that contains an MQTMC2 structure.
At least, if you use the IBM trigger monitor.
Search here for MQTMC2, and reread the documentation on triggering. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Jan 05, 2005 10:05 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
Messages placed in the initiation queue are meant to be consumed by the trigger monitor |
If fact, if the Initiation Q isn't Open for Input by an "application", then no Trigger message will be produced.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Nagashree |
Posted: Fri Jan 14, 2005 12:58 am Post subject: |
|
|
Newbie
Joined: 05 Jan 2005 Posts: 2
|
thanks all of you for your inputs. |
|
Back to top |
|
 |
JT |
Posted: Fri Jan 14, 2005 12:20 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
mqmhr wrote: |
You can use the "TriggerData" property of the queue. The value for this property is set dynamically from the application putting the message into the trigger queue. |
I'm curious, how is this accomplished? |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 14, 2005 12:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The application doing this is the qmgr. The data is read from the queue setup or the process setup... |
|
Back to top |
|
 |
JT |
Posted: Fri Jan 14, 2005 12:32 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Thanks fjb_saper, that's how I knew it to be.
I thought mqmhr might be doing an MQSET against the queue, and modifying the TriggerData value that way. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 14, 2005 12:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well....
depending on how you run this and if the value in there refers to an environment variable... this would open possibilities. As well if your trigger monitor is custom...
Otherwise I doubt that the timing would give you enouth opportunity to mess with the message, unless you are using message exits.
Don't think I ever saw any set up of that kind...
Thanks |
|
Back to top |
|
 |
mqmhr |
Posted: Fri Jan 14, 2005 4:56 pm Post subject: |
|
|
Centurion
Joined: 28 Dec 2004 Posts: 105
|
Hello JT,I think it is possible to issue an MQSET from the application to set the TriggerData property. Which means that each time the putting application sets a new value to this property, trigger message generated will have a new value and a custom trigger monitor is free to make use of the dynamic nature of this property. Correct me if my understanding is wrong.
The App Prog Reference has the following information about TriggerData
This is free-format data that the queue manager inserts into the trigger message when a message arriving on this queue causes a trigger message to be written to the initiation queue.
The content of this data is of no significance to the queue manager. It is
meaningful either to the trigger-monitor application which processes the initiation queue, or to the application which is started by the trigger monitor. The character string cannot contain any nulls. It is padded to the right with blanks if necessary.
To determine the value of this attribute, use the MQCA_TRIGGER_DATA selector with the MQINQ call. To change the value of this attribute, use the MQSET call. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 15, 2005 7:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I would recommend against doing the MQSET unless you opened the queue in exclusive mode.
The timing is such that while you changed the value to A and before you could put the message to the queue the other application changed the value to B and will put its message to the queue.
Now what will the value on the trigger be ?
Enjoy
 |
|
Back to top |
|
 |
kevinf2349 |
Posted: Sat Jan 15, 2005 11:54 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Let me ask a pretty basic question here. What are you trying to accomplish?
If it is simply make sure that a trigger message is generated then it is an awful lot of work just to see that MQ triggers work as advertised.
If you are wanting to step through the application....just set TRIGGER(OFF) on the queue that will eventually be triggered. Then you will see the message on the queue and can manually start the process. If you really need to start different processes...redesign the application...drop the message on a different queue that starts that process. Remember (K.I.S.S).
If the process isn't getting started...check the error logs. If the triggered application is failing.
I am not 100% sure why you want to leave messages on the INITQ but in general this isn't a good idea. If you really need to save that message then I would write my own trigger monitor and read the message from the INITQ and dump it into another queue (and you can make it presistant if you want) but the trigger message really should be removed from the INITQ.
Again it really depends on what you are trying to accomplish, but my advice (for what it is worth) is to keep things as simple as possible. |
|
Back to top |
|
 |
|