Author |
Message
|
pdmenon |
Posted: Mon Jul 19, 2010 11:05 pm Post subject: how to Trigger Script file when a msg is put into queue |
|
|
 Voyager
Joined: 05 Apr 2010 Posts: 80
|
Hi Experts,
I have a requirement like this.
Whenever a message is put into a local queue, a script file should run.
Can a "service" object or "Trigger monitor" help in this regard?
If so, how I can set the parameter values?
Environment is : AIX 5.3
MQVersion : 7.0.0.1
Pls help me in this regard....  |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Jul 19, 2010 11:12 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Yes, MQ Triggering facility will help you in that.
Check the Qlocal 'Triggering' Properties... like Trigger Control (ON), Trigger Type(First/Every/Depth), Trigger Depth, InitQ, ProcessName (which you want to trigger when mesg comes in)
Read the triggering topic , in IBM Infocenter/RedBook. It would do all for you.
* Do check , Trigger Monitor is running !! ( if not, run it.. see : http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa15970_.htm )
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Jul 19, 2010 11:16 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Be clear about the triggering , when it would invoke the script ?
Quote: |
Whenever a message is put into a local queue, a script file should run. |
When FIRST mesg comes to the Queue !
OR
Quote: |
Whenever a message is put into a local queue, a script file should run. |
When ever [ on EVERY ] mesg comes to the Queue !
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
exerk |
Posted: Mon Jul 19, 2010 11:47 pm Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
pdmenon wrote: |
MQVersion : 7.0.0.1 |
At least point him/her to the correct Info Centre for the version being used  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
zpat |
Posted: Tue Jul 20, 2010 12:19 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
What will remove the message from the queue?
The classic set up is trigger first and have the invoked program/script process all the messages in the queue. |
|
Back to top |
|
 |
pdmenon |
Posted: Tue Jul 20, 2010 1:55 am Post subject: |
|
|
 Voyager
Joined: 05 Apr 2010 Posts: 80
|
Appreciate your quick response.
@ shashivarun:When ever [ on [b]EVERY [/b]] mesg comes to the Queue !
Scenario is as follows:
When Application Team clicks on button(from windows xp) say button1 from frontend (using JSP), It will put a msg into the local queue of a qmgr which is in AIX platform. Now, here the case is that, there should not be any separate window for "trigger monitor" to run the script file. And the Trigger monitor should be alive until Queue Manager goes down. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Tue Jul 20, 2010 2:54 am Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
exerk wrote: |
pdmenon wrote: |
MQVersion : 7.0.0.1 |
At least point him/her to the correct Info Centre for the version being used  |
Specifically to this Search Topic, other then 'build' date of that page nothing is different.
But Ya... for other enhanced topics that are in v7 ( those were not in v6 OR were fixed and presented in v7 or later fixes ).. I would make a knot for that. Thank you. _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 20, 2010 4:13 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pdmenon wrote: |
Now, here the case is that, there should not be any separate window for "trigger monitor" to run the script file. And the Trigger monitor should be alive until Queue Manager goes down. |
That's highly doable and described in the documentation.
A word of caution - while the previous comments regarding the difference between "when a message arrives" and "whenever a message arrives" are valid, be very certain before you use EVERY over FIRST. You'd be well advised (apart from reading the documentation) to read some of the discussions in here on triggering. Trigger EVERY is seldom needed, even more seldom a good idea and you need to understand it's use and it's risks before going down that road.
(Or migrate to z/OS & use CICS!! ) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pdmenon |
Posted: Tue Jul 20, 2010 10:21 pm Post subject: |
|
|
 Voyager
Joined: 05 Apr 2010 Posts: 80
|
I found a solution for my problem.
I created a service where in I set the parameters like this:
1. service control :Queue Manager
2. service type: command
3. start command: ../../mqm/bin/runmqtrm <path of trigger monitor>
4. start argument: -m <MyQMGR> -q <LocalQueue>
Just restarted Queue Manager.
That's it. Job done.
Thanx Experts 4 ur views.. |
|
Back to top |
|
 |
|