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!

To trigger or Not to Trigger 1

Status
Not open for further replies.

SameerKhan

Programmer
Apr 8, 2002
11
0
0
US
I am stuck with a design issue .. hope someone can help.

We are very early in the design phase....

We are writin an application .. which responds to requests .. I was thinking of having a trigerred mechanism which woud load my process in memory....

This would be a trigger on FIRST message ..
However .. when the Queue is empty .. i do not want to kill my receiver process.. rather let it keep running for a specified wait time ( I will handle this in the receiver process ) ...

Now when the Q is empty for some time and a message arrives ... and it is still within the wait time .. will it try to create another process if one is already loaded ...

what i would like to know .. is this really a good candidate for Triggering ?

I am sure some of u have had a similar design decision.

Any comments would be really helpful.

-Sam
 
Sameer,
Triggering is a good way to handle processing of requests. What I have done in the past is to let the triggered process loop for a brief period after there are no more messages in the queue. This may pay off in efficiency as new messages arrive during this looping period the original process will handle them. I believe that mqseries will not start a new triggered process while the original one is still running.
 
Your answer depends on your system resource availability, and throughput/volume of messages. I've designed applications that run continuously with an unlimited wait after being triggered. I've also designed apps that wait only 10 seconds for new messages and then terminate. You definately have the right idea here in your design though - trigger on FIRST, then continue getting all messages using a waitinterval. If your volume of messages is sporadic (i.e. 1000 messages, then none for an hour, then 1000 more messages, etc.) then use a low waitinterval (say 30 seconds). However, if you have a steady stream of message flow, use an unlimited wait interval, or set it to some great value like 4 hours.

By the way, MQ will NOT create a new trigger message as long as your original app is still running and connected to the queue. If you close the queue, the trigger will happen.

Cheers,

Scott Meridew
Certified MQSeries Specialist
MQ Squared Inc.
scott@mqsquared.com Scott Meridew
Certified MQSeries Specialist,MCSE
MQ Squared Inc.
 
Thanks much Scott!

More questions to follow ... :)

-Sam

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top