Author |
Message
|
mca |
Posted: Mon Apr 11, 2005 7:27 am Post subject: [solved]Triggering in MQ Series (Unix) |
|
|
Disciple
Joined: 09 Mar 2005 Posts: 196
|
hi,
I am working on Unix Platform and trying to implement the Triggering in MQ series. Here are the details ... I have a Queue Manager "QM" and an local Queue "Q" and my aim here is when i put an message onto the Queue it must trigger my "runmqget" which i have in the same folder and i have written the following code like this:
crtmqm QM
strmqm QM
runmqsc QM
DEFINE QLOCAL(Q) TRIGGER TRIGTYPE(EVERY) INITQ(SYSTEM.DEFAULT.INITIATION.QUEUE) PROCESS(PROC1)
DEFINE PROCESS(PROC1) APPLTYPE(Unix) APPLICID('/var/fmc/ExtApps/runmqget')
END
runmqlsr -t tcp -m QM -p 7777
runmqtrm -m QM -q SYSTEM.DEFAULT.INITIATION.QUEUE
when i tried to run this by typing my runmqput in cmd prompt, its putiing message onto Q but the TRIGGER does not work. and when i type the file name "runmqget" in cmd prompt it gets message and does the work successfully. Here my concern is, it must trigger the "runmqget" program and do the work itself rather than me typing it in cmd prompt.
I tried the same on windows (MQ Explorer) and it worked. But i fear i may be wrong here in syntax or some minor problem as i am getting TRIGGER MESSAGE STARTED in another cmd prompt but it doesn't trigger
Can some one help me by testing the above and corect my mistake. plz ask me if u need any more details.. Thanks in advance.
Last edited by mca on Tue Apr 12, 2005 8:51 am; edited 1 time in total |
|
Back to top |
|
 |
neocruz |
Posted: Mon Apr 11, 2005 7:43 am Post subject: |
|
|
Acolyte
Joined: 13 Jun 2004 Posts: 54
|
I would do a couple of things first.
1. Change the trigger type from "every" to "first". If you use "every", the application has to reset triggering because after it triggers, triggering is basically turned off.
2. Check the path to the app your triggering. And you may not need the single quotes. Not sure.
Hope this helps.
Rich |
|
Back to top |
|
 |
vennela |
Posted: Mon Apr 11, 2005 8:19 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
neocruz wrote: |
1. Change the trigger type from "every" to "first". If you use "every", the application has to reset triggering because after it triggers, triggering is basically turned off.
Rich |
This is true only for TRIGTYPE of DEPTH. For first and every, the trigger will not be turned off.
MCA:
Are you running the trigger monitor in background? Are you sure the trigger monitor is running. Do a ps -ef | grep -v grep | grep runmqtrm and see if you get anything.
Moving to general section |
|
Back to top |
|
 |
mca |
Posted: Mon Apr 11, 2005 8:22 am Post subject: |
|
|
Disciple
Joined: 09 Mar 2005 Posts: 196
|
thanks neocruz for ur immediate reply.
I did change the TriggerType to FIRST and also specified the path taking off the single quotes. The trigger worked but gave me some other error instead. Its like this
Waiting for a trigger message
/VAR/FMC/EXTAPPS/RUNMQGET 'TMC 2Q PROC1 /VAR/FMC/EXTAPPS/RUNMQGET QM '
sh: /VAR/FMC/EXTAPPS/RUNMQGET: not found.
Error starting triggered application.
But i do have that file in my folder and i cross checked by typing "ls" and it showed me the file by that name and if i type the file name in cmd prompt with out any extension it executes(java program). But how come the above error says NOT FOUND. Also i have given lower case path of file in the code i mentioned earlier as UNIX is case sensitive. But it shows in the above message as Upper case. May be its not related with the problem i have but just making a note of it. Thanks for making my work half-complete. |
|
Back to top |
|
 |
neocruz |
Posted: Mon Apr 11, 2005 8:23 am Post subject: |
|
|
Acolyte
Joined: 13 Jun 2004 Posts: 54
|
You are correct. I saw that just after I posted the reply. I'll be 100% sure in the future.
With triggering by depth, the queue manager disables triggering (using the TriggerControl attribute) after it creates a trigger message. Your application must re-enable triggering itself (by using the MQSET call) after this has happened.
Thanks,
Rich |
|
Back to top |
|
 |
vennela |
Posted: Mon Apr 11, 2005 8:25 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
MCA:
Your path is changed to uppercase. Do the following and it should work.
Code: |
alter PROCESS(PROC1) APPLTYPE(Unix) APPLICID("/var/fmc/ExtApps/runmqget")
|
|
|
Back to top |
|
 |
mca |
Posted: Mon Apr 11, 2005 8:41 am Post subject: |
|
|
Disciple
Joined: 09 Mar 2005 Posts: 196
|
thanks venela for the correction. I tried the way u have given, but it gives a syntax error. Guess Double Quotes(") are not accepted. Not sure. Just wanted to find out by displaying the error i got:
1 : ALTER PROCESS(PROC1) APPLTYPE(UNIX) APPLICID("/var/fmc/ExtApps/runmqget")
AMQ8405: Syntax error detected at or near end of command segment below:-
ALTER PROCESS(PROC1) APPLTYPE(UNIX) APPLICID("
AMQ8427: Valid syntax for the MQSC command:
ALTER PROCESS(process_name)
[ APPLICID(string) ]
[ APPLTYPE( CICS | DEF | DOS | OS2 | UNIX | WINDOWS | WINDOWSNT |
OS400 | integer) ]
[ DESCR(string) ]
[ ENVRDATA(string) ]
[ USERDATA(string) ]
Thanks in advance. |
|
Back to top |
|
 |
Anirud |
Posted: Mon Apr 11, 2005 10:03 am Post subject: |
|
|
 Master
Joined: 12 Feb 2004 Posts: 285 Location: Vermont
|
It should work with single quotes (I did check and it works for me with single quotes. My environment is AIX).
Could you give it a try with single quotes? |
|
Back to top |
|
 |
mca |
Posted: Tue Apr 12, 2005 8:51 am Post subject: |
|
|
Disciple
Joined: 09 Mar 2005 Posts: 196
|
Thanks all for sharing their ideas and suggestions. The trigger monitor worked exactly for the code i tried earlier(which i specified in my first post). With single Quotes and TriggerType(every). But i donno why initially it did not work . But now its getting triggered. Thanks all again.
MCA |
|
Back to top |
|
 |
sysera |
Posted: Fri May 20, 2005 12:26 pm Post subject: |
|
|
Acolyte
Joined: 20 May 2005 Posts: 53
|
I realize this has been resolved, but I'm working in a similar situation using this as an example of a trigger setup and running into a bit of a dead end.
I am using SUSE Linux and using the binary /opt/mqm/samp/bin/amqsput to try and put a message into the queue in order to trigger an event but the monitor doesn't seem to respond to my input message at all.
Can someone help me by spelling out exactly the steps I should take in order to send a message to the correct queue in order to trigger the process?
I've got the listener running, but I think I am probably running the put to the wrong place since there is no feedback.
I've tried just doing "amqsput SYSTEM.DEFAULT.INITIATION.QUEUE"
Entering a generic message and seeing if I get a response from the listener, but no luck.
Thanks guys, you have all been helpful so far in viewing this website for insight and answers to my beginner issues! |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri May 20, 2005 12:32 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
sysera wrote: |
Can someone help me by spelling out exactly the steps I should take in order to send a message to the correct queue in order to trigger the process?
|
Read Chapter 13 of the App Prog Ref Manual. It is about triggering.
For starters, you should not be putting messages to the INIT queue. The QM puts tigger messages to the INIT q for the trigger monitor to act on. You should be putting to the trigger app q. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 20, 2005 12:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You do not put any message on the initiation queue. This is the qmgr's job.
You do put a message on the triggered queue.
The queue manager puts a trigger message on the init queue.
The trigger monitor picks it up and starts the corresponding process
Enjoy  |
|
Back to top |
|
 |
sysera |
Posted: Sun May 22, 2005 5:24 pm Post subject: |
|
|
Acolyte
Joined: 20 May 2005 Posts: 53
|
I understand now I believe, the queue as you call it should be "Q" by this forums example.
I apologize if my question seems so out of place. MQSeries is quite new to me so I'm still figuring out all the little pieces as I go along. Thanks a lot guys.  |
|
Back to top |
|
 |
|