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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQCLOSE Fails with 2219 MQRC_CALL_IN_PROGRESS. 1

Status
Not open for further replies.

d3vzero

Technical User
Aug 19, 2002
74
IE
Have an existing Server process which Waits on MQ Messages, and processes them when they come in.

Currently writing, in C, a signal handling routine responsible for the following (on receipt of SIGUSR1).

1. MQCLOSE current Queue.
2. MQDISC current MQ Manager.
3. Re-Read Config File (contains new MQ Conn Info).
4. MQCONN to new MQ Manager obtained from Config File.
5. MQOPEN new Queue obtained from Config File.
6. Continue normal processing.

My problem is that the current Server routines that I'm interfacing with use an MQGET call with the GMO.Options set to MQGMO_WAIT, and the GMO.WaitInterval set to MQWI_UNLIMITED. (ie. Wait forever till you get a message).

In this situation, my routine is called on receipt of the relevent signal, and my MQCLOSE and MQDISC calls fail due to it recognising that the MQGET call has not yet completed.
These MQCLOSE and MQDISC fails result in a Return Code of 2219 (MQRC_CALL_IN_PROGRESS).

So does anyone know of a way, within my signal handling routine, to either
a) Force the MQGET into a fail state, so that the MQCLOSE and MQDISC routines can complete without failure.
b) Force the MQCLOSE and MQDISC routines to operate without care or concern for the state of the preceeding MQGET call.

Help, Opinions, or even just plan sympathy ;-) welcome.

____________________
Sometimes it pays to stay in bed on Monday, rather than spending the rest of the week debuging Mondays code.
 
I assume you want the MQGET to end because you want to close the queue manager down? If so use the Get option MQGMO_FAIL_IF_QUIESCING.

Otherwise code tha application to accept a "closedown" message (I usually use a zero length message for this purpose)
 
Thanks Mate.

I'd tried the MQGMO_FAIL_IF_QUIESCING option, but got the same 2219 errors on attempting to close the queue manager down.

Your other suggestion of a Zero Length closedown message is just the ticket. Now coded and in full working order. :)

I did hunt down another method, which interrupts a 'waiter' by setting the Get-Inhibited status on the queue that the wait is against (so terminating all outstanding get-waits).

Did'nt try it though so I cant speak for how functional it is.

Thanks again. :)

____________________
Sometimes it pays to stay in bed on Monday, rather than spending the rest of the week debuging Mondays code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top