ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Single thread application triggered by 3 separate queues

Post new topic  Reply to topic
 Single thread application triggered by 3 separate queues « View previous topic :: View next topic » 
Author Message
aahmad8
PostPosted: Sun Jan 27, 2008 9:46 pm    Post subject: Single thread application triggered by 3 separate queues Reply with quote

Apprentice

Joined: 12 Sep 2005
Posts: 27
Location: Malaysia

I received a complain from a customer saying that their message is not being process using mq trigger. Further checking I found the following in queue local definition:

Code:

AMQ8409: Display Queue details.
   QUEUE(xxx.xxx.DOWNLOAD.01)        TYPE(QLOCAL)
   PROCESS(xxx.xxx.REQ.PR.02)
AMQ8409: Display Queue details.
   QUEUE(xxx.xxx.REQ.UPD.01)         TYPE(QLOCAL)
   PROCESS(xxx.xxx.REQ.PR.02)
AMQ8409: Display Queue details.
   QUEUE(xxx.xxx.REQ.UPD.02)         TYPE(QLOCAL)
   PROCESS(xxx.xxx.REQ.PR.02)

AMQ8407: Display Process details.
   PROCESS(xxx.xxx.REQ.PR.02)        APPLTYPE(UNIX)
   APPLICID(/exec/appltrig)                ENVRDATA( )
   USERDATA( )                             DESCR(Application trigger process)
   ALTDATE(2006-03-05)                     ALTTIME(02.02.49)


All 3 qlocals using the same initiation queue.

I'm under assumption that since this is a single threaded application, whichever queue that first calls the mq trigger will invoke the application leaving the message in the other 2 queues (not process/trigger) if message arrive in their respective qlocal at the same time.

But if the message arrive at different timing all messages in 3 separate local queues will be triggered via mq trigger and process succesfully eventhough they're pointing to the same application program.

Please correct me if my understanding appear to be incorrect.

Thank you.
_________________
Past, Present & Future of MQ
Back to top
View user's profile Send private message Visit poster's website
zpat
PostPosted: Mon Jan 28, 2008 12:24 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

What type of triggering?

Is the trigger monitor running?
Back to top
View user's profile Send private message
aahmad8
PostPosted: Mon Jan 28, 2008 2:35 am    Post subject: Reply with quote

Apprentice

Joined: 12 Sep 2005
Posts: 27
Location: Malaysia

It's using trigger monitor and in running state.

ps -ef | grep runmqtrm

root 7680082 1 0 04:04:27 - 0:07 runmqtrm -m xxxP11 -q xxxx.xxxP11.INITQ

Thank you.
_________________
Past, Present & Future of MQ
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Mon Jan 28, 2008 3:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Yes, but what kind of triggering? How does the triggered application determine which queue has a message to be processed?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 28, 2008 3:48 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Check the environment data in the process: The triggered app is not running as a background process (& missing).
This might be by design.

You need to be running the trigger monitor in the foreground to understand what is going on. It could well be that your triggered process is hanging...

What you would typically see is that the first message triggering the app gets processed and either all messages on that queue or nothing else because after that the app is hanging / not closing all its processes?

Having root run the trigger monitor is not good. Does root belong to a group that has the right permissions to access the DLQ and the init queue?

I expect that you run the TRM with root because you su to the right user in the execution script? Does that user belong to a group with the right permissions to the DLQ and the triggered queues?

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Mon Jan 28, 2008 10:16 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

If a message hits all 3 queues atthe same time, the QM will generate 3 trigger messages into the INITQ. The Trigger Monitor (TM) will pick up the first one start an instance of that app. Because you didn't tell the TM to start that process in the background, the TM waits for the app to finsih before going back to the INITQ to deal with the remaining 2 trigger messages, plus any others that may have piled up.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/fg13970_.htm

If you change your process definitions to start up your app in the background the TM is unleashed to work as fast as it can processing trigger messages as fast as the QM creates them.

The manuals are excellent in detailing when and how trigger messages are created. I feel they could be a bit more detailed when it comes to explaining how and when trigger monitors consume the trigger messages.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
aahmad8
PostPosted: Mon Jan 28, 2008 9:08 pm    Post subject: Reply with quote

Apprentice

Joined: 12 Sep 2005
Posts: 27
Location: Malaysia

zpat wrote:
What type of triggering?

Is the trigger monitor running?


Code:

AMQ8409: Display Queue details.
   QUEUE(xxx.xxxP11.DOWNLOAD.01)        TYPE(QLOCAL)
   ACCTQ(QMGR)                             ALTDATE(2006-03-14)
   ALTTIME(10.40.14)                       BOQNAME( )
   BOTHRESH(0)                             CLUSNL( )
   CLUSTER( )                              CLWLPRTY(0)
   CLWLRANK(0)                             CLWLUSEQ(QMGR)
   CRDATE(2006-03-10)                      CRTIME(15.47.50)
   CURDEPTH(0)                             DEFBIND(OPEN)
   DEFPRTY(0)                              DEFPSIST(YES)
   DEFSOPT(SHARED)                         DEFTYPE(PREDEFINED)
   DESCR(BSS)                              DISTL(NO)
   GET(ENABLED)                            NOHARDENBO
   INITQ(xxxx.xxxP11.INITQ)                IPPROCS(0)
   MAXDEPTH(640000)                        MAXMSGL(4194304)
   MONQ(QMGR)                              MSGDLVSQ(PRIORITY)
   TRIGGER                                 NPMCLASS(NORMAL)
   OPPROCS(0)                              PROCESS(xxx.xxxP11.REQ.PR.02)
   PUT(ENABLED)                            QDEPTHHI(80)
   QDEPTHLO(20)                            QDPHIEV(DISABLED)
   QDPLOEV(DISABLED)                       QDPMAXEV(ENABLED)
   QSVCIEV(NONE)                           QSVCINT(999999999)
   RETINTVL(36000)                         SCOPE(QMGR)
   SHARE                                   STATQ(QMGR)
   TRIGDATA( )                             TRIGDPTH(1)
   TRIGMPRI(0)                             TRIGTYPE(FIRST)
   USAGE(NORMAL)


Code:

AMQ8409: Display Queue details.
   QUEUE(xxx.xxxP11.REQ.UPD.01)         TYPE(QLOCAL)
   ACCTQ(QMGR)                             ALTDATE(2007-11-17)
   ALTTIME(08.54.41)                       BOQNAME( )
   BOTHRESH(0)                             CLUSNL( )
   CLUSTER( )                              CLWLPRTY(0)
   CLWLRANK(0)                             CLWLUSEQ(QMGR)
   CRDATE(2006-03-10)                      CRTIME(15.47.50)
   CURDEPTH(0)                             DEFBIND(OPEN)
   DEFPRTY(0)                              DEFPSIST(YES)
   DEFSOPT(SHARED)                         DEFTYPE(PREDEFINED)
   DESCR(BSS)                              DISTL(NO)
   GET(ENABLED)                            NOHARDENBO
   INITQ(xxxx.xxxP11.INITQ)                IPPROCS(0)
   MAXDEPTH(640000)                        MAXMSGL(4194304)
   MONQ(QMGR)                              MSGDLVSQ(PRIORITY)
   TRIGGER                                 NPMCLASS(NORMAL)
   OPPROCS(1)                              PROCESS(xxx.xxxP11.REQ.PR.02)
   PUT(ENABLED)                            QDEPTHHI(80)
   QDEPTHLO(20)                            QDPHIEV(DISABLED)
   QDPLOEV(DISABLED)                       QDPMAXEV(ENABLED)
   QSVCIEV(NONE)                           QSVCINT(999999999)
   RETINTVL(36000)                         SCOPE(QMGR)
   SHARE                                   STATQ(QMGR)
   TRIGDATA( )                             TRIGDPTH(1)
   TRIGMPRI(0)                             TRIGTYPE(EVERY)
   USAGE(NORMAL)


Code:

AMQ8409: Display Queue details.
   QUEUE(xxx.xxxP11.REQ.UPD.02)         TYPE(QLOCAL)
   ACCTQ(QMGR)                             ALTDATE(2006-03-03)
   ALTTIME(16.50.20)                       BOQNAME( )
   BOTHRESH(0)                             CLUSNL( )
   CLUSTER( )                              CLWLPRTY(0)
   CLWLRANK(0)                             CLWLUSEQ(QMGR)
   CRDATE(2006-02-20)                      CRTIME(08.54.33)
   CURDEPTH(0)                             DEFBIND(OPEN)
   DEFPRTY(0)                              DEFPSIST(YES)
   DEFSOPT(SHARED)                         DEFTYPE(PREDEFINED)
   DESCR(MGCC R3)                          DISTL(NO)
   GET(ENABLED)                            NOHARDENBO
   INITQ(xxx.xxxP11.INITQ)                IPPROCS(0)
   MAXDEPTH(640000)                        MAXMSGL(4194304)
   MONQ(QMGR)                              MSGDLVSQ(PRIORITY)
   TRIGGER                                 NPMCLASS(NORMAL)
   OPPROCS(0)                              PROCESS(xxx.xxxP11.REQ.PR.02)
   PUT(ENABLED)                            QDEPTHHI(80)
   QDEPTHLO(20)                            QDPHIEV(DISABLED)
   QDPLOEV(DISABLED)                       QDPMAXEV(ENABLED)
   QSVCIEV(NONE)                           QSVCINT(999999999)
   RETINTVL(36000)                         SCOPE(QMGR)
   SHARE                                   STATQ(QMGR)
   TRIGDATA( )                             TRIGDPTH(1)
   TRIGMPRI(0)                             TRIGTYPE(EVERY)
   USAGE(NORMAL)


ql(xxx.xxxP11.DOWNLOAD.01) TRIGTYPE(FIRST)
ql(xxx.xxxP11.REQ.UPD.01) TRIGTYPE(EVERY)
ql(xxx.xxxP11.REQ.UPD.02) TRIGTYPE(EVERY)

Yes. The trigger monitor running in the background
_________________
Past, Present & Future of MQ
Back to top
View user's profile Send private message Visit poster's website
aahmad8
PostPosted: Mon Jan 28, 2008 9:24 pm    Post subject: Reply with quote

Apprentice

Joined: 12 Sep 2005
Posts: 27
Location: Malaysia

Vitor wrote:
Yes, but what kind of triggering? How does the triggered application determine which queue has a message to be processed?


I've both trigtype first and every. Refer my earlier reply.

If you look at my reply above all the 3 qlocals using similar process queue. Obviously it will be calling the same application whenever messages arive all at 3 difference qlocals.

What I am not sure here is that will every single messages in these 3 qlocals get process simultenously if messages arive at the same time? I came to know the application is single threaded and is not design to handle multi-threaded.
_________________
Past, Present & Future of MQ
Back to top
View user's profile Send private message Visit poster's website
aahmad8
PostPosted: Mon Jan 28, 2008 9:37 pm    Post subject: Reply with quote

Apprentice

Joined: 12 Sep 2005
Posts: 27
Location: Malaysia

fjb_saper wrote:
Check the environment data in the process: The triggered app is not running as a background process (& missing).
This might be by design.

You need to be running the trigger monitor in the foreground to understand what is going on. It could well be that your triggered process is hanging...

What you would typically see is that the first message triggering the app gets processed and either all messages on that queue or nothing else because after that the app is hanging / not closing all its processes?

Having root run the trigger monitor is not good. Does root belong to a group that has the right permissions to access the DLQ and the init queue?

I expect that you run the TRM with root because you su to the right user in the execution script? Does that user belong to a group with the right permissions to the DLQ and the triggered queues?

Enjoy


Trigger monitor is running in the background. Sorry didn't mentioned that earlier.

User complained to me that the trigger is halted/hanging. User also do not have any problem when they execute the application(/exec/appltrig). I also notice the initiation queue ((xxxx.xxxP11.INITQ) messages pileup at that time. What is the best action I should take whenever I see message in initiation queue is greater than 0 and not reducing in anyway?

As for root id issue it was by design mistake I believe. It was setup by IBM in my country then I came into the picture to support the MQ. I will have to find more info about that Id from our AIX system administrator later today.
_________________
Past, Present & Future of MQ
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Tue Jan 29, 2008 1:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Run the trigger monitor in the foreground or redirect its output to a file.
You should then be able to see the actions taken by the trigger monitor.

Something is not running right, possibly the parameters not being passed right when the process is called via su?

Or root not having enough rights on MQ?

I'd say the application is not handling its error conditions nicely...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Tue Jan 29, 2008 8:31 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

aahmad8 wrote:
What is the best action I should take whenever I see message in initiation queue is greater than 0 and not reducing in anyway?


PeterPotkay wrote:
If a message hits all 3 queues atthe same time, the QM will generate 3 trigger messages into the INITQ. The Trigger Monitor (TM) will pick up the first one start an instance of that app. Because you didn't tell the TM to start that process in the background, the TM waits for the app to finsih before going back to the INITQ to deal with the remaining 2 trigger messages, plus any others that may have piled up.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzal.doc/fg13970_.htm

If you change your process definitions to start up your app in the background the TM is unleashed to work as fast as it can processing trigger messages as fast as the QM creates them.

The manuals are excellent in detailing when and how trigger messages are created. I feel they could be a bit more detailed when it comes to explaining how and when trigger monitors consume the trigger messages.

_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Single thread application triggered by 3 separate queues
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.