Posted: Mon Aug 31, 2009 1:51 am Post subject: MQ - Jobs running parallely..
Newbie
Joined: 31 Aug 2009 Posts: 1
I have two jobs one to PUT messages in Queue and Other to GET the reply messages from Queue. These two jobs should run paralley.My fisrt job which PUT the messages in Queue stops when there are no records in the input file. Can any one suggest me how to stop my second job? I need to get all the reply messages for all the requests i have PUT through the first job.
Research MQRC2033 and MQGMO WaitInterval. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Posted: Mon Aug 31, 2009 4:19 pm Post subject: Re: MQ - Jobs running parallely..
Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
naidu540 wrote:
I have two jobs one to PUT messages in Queue and Other to GET the reply messages from Queue. These two jobs should run paralley.My fisrt job which PUT the messages in Queue stops when there are no records in the input file. Can any one suggest me how to stop my second job? I need to get all the reply messages for all the requests i have PUT through the first job.
You need some way of telling the GET job that it has got the last message that it needs to process?
Common techniques are to set an "indicator" on the last message (eg. special value of CorrelId) or to put a special message after the last message (eg. message data is 3 bytes "EOF").
WaitInterval plus test for MQRC_NO_MESSAGE_AVAILABLE is also a valid solution, provided the GET job can tolerate some dead time while it is waiting around for the interval to expire after the last message has been received. The question is: How long should you wait? What is the longest possible delay that the PUT job might experience delivering messages to the queue? 1 second? 10 seconds? 60 seconds?
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