I am building a server process for processing messages from one
request queue and putting the result back on another response queue.
Various clients will put messages in the request queue and will wait
response in the response queue.
In the server process, for getting the messages from the request
queue, here are 2 options
Polling:
loop
{
1: call the GET method on request queue (with no wait or no blocking)
2: get message and process message
3: wait for some time (say some milliseconds)
}
Listening:
Loop
{
1: call the GET method on request queue (with wait or blocking for
some seconds, MQC.MQGMO_WAIT option)
2: get and process message
3: catch no message exception
}
Which one is the better method?
Thanks
Listening is superior because it will get the message as soon as
it arrives on the queue, whereas the polling "wait" will introduce an
unnecessary delay. Polling also wastes CPU time by making lots
of calls to MQGET when there are no messages on the queue.
Polling will still have to catch the no message exception (ReasonCode
2033).
Glenn.
I'm using c++ and the Imq classes
Cheers
--
posted via MFF : http://www.MainFrameForum.com - USENET Gateway
However, make sure that you specify FAIL_IF_QUIESCING on your calls. This
will break out of the get if the qmgr is shutting down.
Ron
"Crisps" <mem...@mainframeforum.com> wrote in message
news:c4j54u$4ook$1...@news.boulder.ibm.com...