Author |
Message
|
EOTIII |
Posted: Fri Mar 01, 2002 1:11 pm Post subject: |
|
|
 Newbie
Joined: 28 Feb 2002 Posts: 8 Location: Richmond, VA
|
I am using MQ 5.2.1 on W2K. I have written a very simple program to log to the event log. I set the trigger queue to "Every". As I put messages, the program is triggered. But only one instance will run at a time. When I check the event log, I see that all of the programs ran. I have put a 15 sec delay to try to get more that one at a time to run, but no matter what I do, they will only run serialally.
Help! |
|
Back to top |
|
 |
mqonnet |
Posted: Fri Mar 01, 2002 1:22 pm Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
From what i understand you want to be able to run the same program simultaneously using application triggering.
Ok. First of all setting Every does not mean that if you put 10 messages you would have simultaneous 10 apps started/triggered. It means that any message that arrives on the queue would trigger the application mentioned in the process def.
Hmm... I have not done this before, but i would think if you stop your trigger mon, put all the messages on the queue, set it to every, and then start your trigger mon, it might help you see more than one app at a time. But i am not sure if it will. Because Triggering is serial as is MQ. And it would serve the first message first and then follows with the second one.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
StefanSievert |
Posted: Fri Mar 01, 2002 6:46 pm Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Hi,
the product supplied trigger monitor on Windows starts the triggered application using the system() call, which is inherently synchronous, i.e. control is not returned to the trigger monitor until the triggered application finished.
Solution 1: Preceed the APPLICID in your process definition with 'START ', for example 'START NOTEPAD.EXE'
Solution 2: Put your application invocation in a batch file and trigger that batch file. The file can look like this:
echo off
START yourprogramname
EXIT
The last line is important, because otherwise you will have a DOS command window left open for each triggered instance of the batch file. This will ultimately lead to Windows throwing up on you due to exhausted system resources.
Hope that helps,
Stefan
_________________ Stefan Sievert
IBM Certified * WebSphere MQ |
|
Back to top |
|
 |
srinigamini |
Posted: Sat Mar 02, 2002 9:11 pm Post subject: |
|
|
Newbie
Joined: 01 Mar 2002 Posts: 1
|
Can't we simulate this situation like multithreaded application. In J2EE we can use Message Driven Beans, here each message executes in a separate instance of bean. How can we achieve the same with triggering in MQSeries.
Thanks,
Srini |
|
Back to top |
|
 |
kolban |
Posted: Sat Mar 02, 2002 11:05 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
MQSeries triggering provides for the automatic creation of a new message called an initiation message when a trigger on a queue is reached. The initiation message is fully documented by IBM. The IBM supplied trigger monitor is simply an "example" of a program which can intepret and process initiation messages. You can craft any program to watch for initiation messages (caused by triggering) and process as you need. If the IBM supplied trigger monitor is not sufficient, perhaps you could come back with some more details of what you need and we can design something on the forums. |
|
Back to top |
|
 |
EOTIII |
Posted: Mon Mar 04, 2002 10:11 am Post subject: |
|
|
 Newbie
Joined: 28 Feb 2002 Posts: 8 Location: Richmond, VA
|
Thanks for the help. I used "START ProgramName /B" and it worked the way I needed. I will be using this technique to write a triggered program (By Depth) to start another exe if it can not empty the queue fast enough. |
|
Back to top |
|
 |
StefanSievert |
Posted: Mon Mar 04, 2002 1:21 pm Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Quote: |
Thanks for the help. I used "START ProgramName /B" and it worked the way I needed. I will be using this technique to write a triggered program (By Depth) to start another exe if it can not empty the queue fast enough.
|
Just a little reminder, in case you haven't caught that from the docs on triggering: If you set TRIGTYPE(DEPTH), MQSeries will set the application queue to NOTRIGGER, after the trigger has fired. So, one thing you would need to do is re-enable triggering as the last action in your triggered program using the MQSET API call.
I would suggest that you look into using QDPHIEV (queue depth high) events for that purpose. For a description on how these work, please refer to the Programmable Systems Management manual (Chapter 3: Understanding performance events).
Cheers,
Stefan
[ This Message was edited by: StefanSievert on 2002-03-04 13:29 ] |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Mar 04, 2002 9:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Use "START ProgramName" and not "START ProgramName /B". Secondly, if you really, really want to use the /B option then the command is: "START /B ProgramName".
Please read the Windows NT/2000 docs because "/B" does not mean run in the background (as most people thinks it does).
later
Roger...
|
|
Back to top |
|
 |
|