Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Triggering with MQSeries for windows NT 4

Status
Not open for further replies.

khanda

Programmer
Aug 1, 2000
1
0
0
CA
I created 2 queues managers with 1 queue on each,join them in a cluster and put a trigger on on both. <br>I create a process and named it. In apllication ID field I put :&quot;c:\winnt\notepad.exe&quot; just to test the trigger when it occurs. But I see that the trigger is working and always gaving me the same maessage: Not a valid trigger message&quot;.<br>Please help.<br>
 
It sounds like you are using the local application queue as your initiation queue.<br><br>The way that MQSeries triggering works is when a message appears on your application's queue, assuming that the triggering conditions are satisfied, a trigger message is generated and placed onto the initiation queue specified in the application queue definition (the INITQ parameter). Your trigger monitor (runmqtrm) should be waiting for messages to appear on the initiation queue and when one does, it launches the program as specified by the application queue's Application Id (notepad.exe in your case).<br><br>Hope this helps,<br>Paul
 
Is any one can help me for triggering.
The problem is I created a queue manger and a queue.I set conditons for triggering.Whenver the message I am putting inside the queue,It goes off and am not able to see anything.I have given in the appid field &quot;c:\winnt\notepad.exe&quot;.But It is not showing anything.
Is any one can help me how to set conditons for triggering and how to work with it
 
As paul mentioned, you need to have two queues defined for triggering. One is the input queue, where messages arrive. The other is the INIT queue, where trigger messages are put by the Queue Manager.

Here's the sequence:

1) Application A puts a message into Queue AppB (where AppB is set up as a trigger queue with INIT.Q as the INIT Queue and ProcessB as the process definition).
2) The Queue Manager creates a trigger message and puts this message on the INIT.Q queue.
3) Your trigger monitor (defined using MQSeries Services MMC snap-in) picks up the trigger message from the INIT.Q queue and launches the applicationID defined by ProcessB (we'll call it Application B)
4) Application B launches and picks up the message from the AppB queue.

Having said all this, you cannot trigger notepad.exe as your Application B, since notepad.exe does not know how to retrieve messages from a queue (unless you have created a custom notepad.exe program that is).

Cheers,

Scott.
 
So, I can trigger only special application?
And I can't even start any application just by the event, without writting my own mqseries-oriented program that will be launched on trigger, eat specific information from queue, and, in turn, start the application I need? Am I right?

Thank you.
Kissel.
 
Well, you can launch any program you want using the Trigger Monitor - but there's usually not much point in triggering a program unless that program then goes on to process the message that caused it to be triggered.

And if you think about it, you will obviously have to write this program yourself since no-one else knows what you want to do with the message!

Cheers,
Paul
 
I bag your pardon for time-wasting ... But I just can't figure out, what is the major difference between launching application that eats messages by the trigger monitor and by the other way... e.g. sheduling or smth.

So, the story. We got a simple application that puts information from MQS message to the database via the OLE automation. If this application launched from a command line or by a task sheduler it works fine. If it launched by the trigger monitor, it couldn't properly initialize the database OLE server. UI interaction is not required. It creates object in memory, and uses it. Than it have to call a initialization method and this method fails (returns false).

So, the questions are:
1. Is there a way to define a user account for the trigger monitor? Are there any problems regarding to that?
2. May be the problem in window station? Is there any restrictions? The interaction with a filesystem working just fine.

Where should I look for info?
Thank you even if not intend to answer - just for reading... : )
 
There is no difference between an application launched via a trigger monitor and one launched in any other way. The userid of the triggered program is that which the trigger monitor is running under itself - usually MUSR_MQADMIN although you can change this for the entire QMgr if you like.

To have only the trigger monitor running under a different userid, the only way I know how to do this is to launch it yourself using runmqtrm rather than letting the MQSeries service do it automatically.

Also, a triggered process gets a Trigger Message (TMC) passed to it as a parameter. This contains the triggered queue, trigger data etc. Obviously your manually launched program will not expect this as a parameter.

Cheers,
Paul
 
I have this queue/manager setup for our server and it works flawlessly. Perhaps you can work with it a bit. Also, check IBM's Support Pack site and download the MA01 pack as it requires it.

DEFINE QLOCAL (WORTS.ORDERS.QUEUE) +
PROCESS (WORTS.PROCESS) +
MAXMSGL (2000) +
DEFPSIST (YES) +
INITQ (WORTS.ORDERS.INIT.QUEUE) +
TRIGGER +
TRIGTYPE (DEPTH) +
TRIGDPTH (5) +
TRIGMPRI (5)

DEFINE QLOCAL(WORTS.ORDERS.INIT.QUEUE) +
GET (ENABLED) +
NOSHARE +
NOTRIGGER +
MAXMSGL (2000) +
MAXDEPTH (1000)

DEFINE PROCESS (WORTS.PROCESS) +
DESCR (‘Get orders for processing’) +
APPLTYPE (NT) +
APPLICID (’c:\scripts\q.exe') +
USERDATA ('-iWORTS.ORDERS.QUEUE, close, 235')

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top