Author |
Message
|
hi_sharan |
Posted: Wed Jun 11, 2014 2:43 am Post subject: MQ trigger bot working.. |
|
|
Newbie
Joined: 30 May 2014 Posts: 3
|
Hi all,
I am using WMQ v6.0.
I want to open the calculator application using trigger.
I defined local queue,initiation queue,process definition,services.
The message what i was putting in the local queue is going to initiation queue and stucking in there without triggering the calculator application.
LOCAL QUEUE PROPERTIES:
Local queue name:QL_TEST_QUEUE
Triggeing control : ON
Triggering Type: Every
Trigger Depth : 1
Trigger Message Priority : 0
Initiation Queue: QI_TEST_QUEUE
Process Definition : PR_TEST_QUEUE
INITIATION QUEUE :CREATED
SERVICES: SV_TEST_QUEUE
Start command: D:\WebsphereMQ\bin\runmqtrm
Start args: -m QMGRA -q QI_TEST_QUEUE
Services:running
Process Defintion:PR_TEST_QUEUE
Application ID : C:WINDOWS\system32\calc.exe
I HAVE A DOUBT,WHETHER MY TRIGGER MONITOR IS WORKING FINE TO MONITOR THE INITIATION QUEUE AND TO START THE APPLICATION.
Initiation queue : QI_TEST_QUEUE
Open input count :1
Please help me,as this task is important for me. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 11, 2014 4:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Since when does the calculator application run in the background without a window?
This is essentially what triggering is for. Not to interact with the GUI!
Working as designed ... Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Jun 11, 2014 5:45 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I didn't know the 'calculator' had code in it to read WMQ Data?
You learn something new every day but I don't think this is it. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
zpat |
Posted: Wed Jun 11, 2014 6:30 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
And why are you using a version of MQ that was out of date years ago? _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Jun 11, 2014 2:17 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
I used Calculator and Notepad and Clock to play with triggering initially, now over 10 years ago. The difficulties in getting them to work only helped me better understand triggering.
hi_sharan, open up Task Manager on the Windows machine, make sure you show processes from all users in that Task Manager, and repeat your testing. You may be pleasantly surprised what new processes you see in Task Manager if you got all the pieces set up right. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
PaulClarke |
Posted: Wed Jun 11, 2014 10:26 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Sharan,
The problem with triggering a non-MQ program like calculator is that it doesn't access the triggered queue at all. This means that you only get one shot at seeing the triggering happen since the queue is not being emptied. So, you have to make certain the queue is empty yourself manually before you put a message to the queue.
Just to be clear though, the initiation queue to use is determined by the environment you want the application started in. For example, you might have an initiation queue for CICS applications, one for IMS, one for Batch, one for Windows application etc. You do not, in general, define a new initiation queue for each application queue. If you understand this and are just playing with triggering then fine, I just want to ensure you understand the principals. In this case I see no reason not to use the default Distributed initiation queue SYSTEM.DEFAULT.INITIATION.QUEUE. However, by all means define a new one if you wish, as long as you have a separate instance of a trigger monitor running against each one you are using you should be fine. Having said that you need to ensure that the command you issue starts the program in the background and doesn't run in the foreground. The last thing thing you need is an initiator suspended waiting for a triggered program to end.
So, update your definitions, empty the applications queue, start the RUNMQTRM, ensure triggering is enabled and try the put again. See what is output by the trigger monitor program.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Jun 12, 2014 8:24 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
PaulClarke wrote: |
The problem with triggering a non-MQ program like calculator is that it doesn't access the triggered queue at all. This means that you only get one shot at seeing the triggering happen since the queue is not being emptied. So, you have to make certain the queue is empty yourself manually before you put a message to the queue. |
A few thoughts on this:
I agree with Paul that it is unusual (and seemingly not contemplated by the folks at the WMQ factory) that a triggered app would not consume the message in the triggered queue.
In a brain-storming (BS) session, one of my clients contemplated doing this precise thing - using WMQ triggering to initiate a non-MQ-aware app (although not calculator, notepad, or similar).
One possibility of simulating the emptying of the queue would be to set a low expiry value on the message. Queue depth would return to zero, and trigtype(first) event would occur on the next message.
Another possibility would be to modify runmqtrm to consume the message from the triggered queue, and then launch the non-MQ-aware app.
Just like pipe-cleaners and paper-clips, the possible uses of WMQ are endless.  _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jun 12, 2014 9:10 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
bruce2359 wrote: |
One possibility of simulating the emptying of the queue would be to set a low expiry value on the message. Queue depth would return to zero, and trigtype(first) event would occur on the next message.
|
The queue depth may not go to zero, ever, if nothing is attempting to consume a message from the queue.
The Expiry Scavenger only considers loaded or active queues in its To Do list. If the message is put, and the queue is closed and nothing else every opens it, the expired message will sit there forever. Well, until the next QM restart anyway.
The QM's Trigger Interval property would help here though. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
PaulClarke |
Posted: Thu Jun 12, 2014 9:26 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Bruce,
I'm not sure I see the point of triggering a non-MQ aware program. What actual problem was your BS session working on? If you want to use MQ to start a non-MQ program why not just go direct? It would be trivial to write a simple MQ program which would read messages from a queue and issue whatever command it was given. From anywhere you could then send a message which says 'go run this'. What does adding triggering in to the mix buy you ?
Of course if you were to write such a 'issue any command' program you ought to be very careful about security or at the very least ensure your CV is up to date.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Jun 12, 2014 12:55 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
PaulClarke wrote: |
I'm not sure I see the point of triggering a non-MQ aware program. What actual problem was your BS session working on? |
The client had zero automated ops software. The question posed was similar to that of the OP, namely: can an app be started because an event took place? Can this event be on another o/s? Must the started app be MQ-aware?
They were looking for a solution with existing tools - a MacGuyver solution.
Are there better ways to do this? Of course. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
ajaywmq |
Posted: Mon Jun 30, 2014 8:28 am Post subject: MQ trigger bot working.. |
|
|
Newbie
Joined: 30 Jun 2014 Posts: 2
|
HI
i have an question
how can we start the trigger monitor in background |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jun 30, 2014 9:19 am Post subject: Re: MQ trigger bot working.. |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
ajaywmq wrote: |
HI
i have an question
how can we start the trigger monitor in background |
I might wonder if
1) there is a command for this?
2) I can configure the Trigger Monitor to start with the Queue Manager?
What do you think? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
|