Author |
Message
|
louiezhang |
Posted: Mon Apr 21, 2008 1:01 pm Post subject: local queue's trigger issue. |
|
|
Novice
Joined: 25 Oct 2007 Posts: 10
|
hi, guys
I have to look for some help from forum.
I define a queue with trigger. And I start trigger monitor and use amqsput sending msg. My trigger set to be fire up when qdepth is 5. First time, right after I input the 5th msg, trigger fire up my script and clear the msg in the q. But strange thing is I found the q set to notrigger the same time. Thus next 5 msg I input won't trigger anything coz q has been set to notrigger after the first trigger event happened.
My question is, is that trigger monitor update my q to notrigger after it fires up? Is that a default behavior? I really don't want that happens coz i am trying to make it like, each time when msg depth 5, then trigger shell script to clear msg out. Now it only work for first time.
Pls help, thx.
Below is definition and script
DELETE QL(S1TEST.QUEUE)
DEFINE QLOCAL (S1TEST.QUEUE) +
PROCESS (S1TEST.QUEUE.PROCESS) +
MAXMSGL (2000) +
DEFPSIST (YES) +
INITQ (S1TEST.INIT.QUEUE) +
TRIGGER +
TRIGTYPE (DEPTH) +
TRIGDPTH (5) +
TRIGMPRI (0)
DELETE QL(S1TEST.INIT.QUEUE)
DEFINE QLOCAL(S1TEST.INIT.QUEUE) +
GET (ENABLED) +
NOSHARE +
NOTRIGGER +
MAXMSGL (2000) +
MAXDEPTH (1000)
DELETE PROCESS(S1TEST.QUEUE.PROCESS)
DEFINE PROCESS (S1TEST.QUEUE.PROCESS) +
DESCR ('test message processing') +
APPLTYPE (UNIX) +
APPLICID ('/export/home/mqm/clear_s1msg.sh') +
USERDATA ('')
I start trigger monitor by
runmqtrm -m HUB -q S1TEST.INIT.QUEUE
'/export/home/mqm/clear_s1msg.sh'
/export/home/mqm/mqhealth/q -c819 -Ca -dhfd3 -IS1TEST.QUEUE -mRMAD1> RMAD1_S1TEST.QUEUE_msg_dump
.txt |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 21, 2008 1:21 pm Post subject: Re: local queue's trigger issue. |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
louiezhang wrote: |
is that trigger monitor update my q to notrigger after it fires up? |
No... it's the queue manager.
louiezhang wrote: |
Is that a default behavior? |
Yes.
louiezhang wrote: |
I really don't want that happens coz i am trying to make it like, each time when msg depth 5, then trigger shell script to clear msg out. Now it only work for first time. |
You need to write your own program to do this. You can't use triggering this way.
Or change your program that is triggered to reset the queue to trigger, when it is finished processing messages. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Apr 21, 2008 1:22 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
This is working as designed - correctly. When a trigger fires for a trigger type of depth, triggering is turned off. It is the responsibility of the program to turn it back on, if necessary.
Refer to the WMQ Application Programming Reference and WMQ Application Programming Guide for trigger type depth. _________________ 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 |
|
 |
louiezhang |
Posted: Mon Apr 21, 2008 1:35 pm Post subject: |
|
|
Novice
Joined: 25 Oct 2007 Posts: 10
|
wow, amazing I got answer this quick.
Thanks for all reply msg. I understand I have to use programe (my script) to turn tirgger back on each time. Good to know.
Cheers!  |
|
Back to top |
|
 |
louiezhang |
Posted: Mon Apr 21, 2008 1:42 pm Post subject: |
|
|
Novice
Joined: 25 Oct 2007 Posts: 10
|
btw, my idea works simply by update clear_msg.sh to
/export/home/mqm/mqhealth/q -c819 -Ca -dhfd3 -IS1TEST.QUEUE -mRMAD1> RMAD1_S1TEST.QUEUE_msg_dump.txt
echo "ALTER QUEUE(S1TEST.QUEUE) TRIGGER"|runmqsc RMAD1 |
|
Back to top |
|
 |
louiezhang |
Posted: Mon Apr 21, 2008 1:57 pm Post subject: |
|
|
Novice
Joined: 25 Oct 2007 Posts: 10
|
Further question, I tried xmitq with trigger b4, but type is FIRST. But it seems xmitq's trigger never got set to notrigger. So is it because of xmitq or TRIGTYPE( FIRST )?
DEFINE QLOCAL( 'A_B.CH01.XMITQ' ) +
* Common queue attributes
DESCR( 'Transmission queue for sending message from A to B) +
PUT( ENABLED ) +
DEFPRTY( 5 ) +
DEFPSIST( NO ) +
DEFBIND( OPEN ) +
* Local queue attributes
GET( ENABLED ) +
SHARE +
DEFSOPT( SHARED ) +
MSGDLVSQ( FIFO ) +
RETINTVL( 999999999 ) +
MAXDEPTH( 5000 ) +
MAXMSGL( 4194304 ) +
NOHARDENBO +
BOTHRESH( 0 ) +
BOQNAME( ' ' ) +
USAGE( XMITQ ) +
* Event control attributes
QDPMAXEV( ENABLED ) +
QDPHIEV( DISABLED ) +
QDEPTHHI( 80 ) +
QDPLOEV( DISABLED ) +
QDEPTHLO( 40 ) +
QSVCIEV( NONE ) +
QSVCINT( 999999999 ) +
* Trigger attributes
TRIGGER +
TRIGTYPE( FIRST ) +
TRIGMPRI( 0 ) +
TRIGDPTH( 1 ) +
TRIGDATA( ' ' ) +
PROCESS( 'A_B.CH01.PROCESS' ) +
INITQ( 'SYSTEM.CHANNEL.INITQ' ) |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Apr 21, 2008 2:04 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
Trigger type depth is the only one that turns triggering off. Please refer to the application programming manuals for definitions of triggers, and how to use them. _________________ 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 |
|
 |
AkankshA |
Posted: Mon Apr 21, 2008 8:11 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
louiezhang wrote: |
Further question, I tried xmitq with trigger b4, but type is FIRST. But it seems xmitq's trigger never got set to notrigger. So is it because of xmitq or TRIGTYPE( FIRST )?
|
TRIGTYPE(FIRST) and TRIGTYPE(EVERY) do not need resetting... _________________ Cheers |
|
Back to top |
|
 |
|