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

Connection to Queue fails after a while...

Status
Not open for further replies.

apy

Programmer
Jun 16, 2003
3
CH
hi, i've got following problem:

I'm connecting a MQSeries Client Java appl. running on AIX(4.3) to a MQ Queue Manager sitting on an OS/390, and I'm reading messages out of the queue.
The application works fine for a while (alway about 2 hours) and then suddently
stops fetching the message from the queue, but no exception or error is thrown, and the main program thread is still alive.
Here the method that I call and that doesn't return: com.ibm.mq.MQQueue.get(MQMessage,MQGetMessageOptions)

Has anyone any idea what could be the reason for this behaviour?

here is the code
...
while (isRunning()) {
try {

if (isTxMode || isTransOn)
{
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_SYNCPOINT | MQC.MQGMO_FAIL_IF_QUIESCING;
}
else
{
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_NO_SYNCPOINT | MQC.MQGMO_FAIL_IF_QUIESCING;
}

msg = new MQMessage();
getReceiveQueue().get(msg, gmo);

 
Need the complete source and the exact problem.

Dont know what is the wait interval that you specified. Clould it be that you did not and hence it is not waiting any more.

Are the messages that you are trying to retrieve committed???



Cheers
KK
 
The exact problem is that the GET(msg, msgoption) method of the MQQueue Class does never return after having worked fine for 2 hours, the program just stops there, and of course the messages remains in the queue afterwards.

I do a polling of the queue every 1000 ms, if no message is in the queue I catch the MQException thrown because no message was put into queue and go on polling. If a message was put into queue I handle it.

 
When you say, it stays there what do you mean.
Does this mean that your get waits forever. But since you specified mqgmo_wait in your gmo options, you must have speicified some wait interval. What is that. Your get should wait only until that time and then return 2033. Is this what is happenning???

As i asked you earlier. What is the wait interval that you are using. Also do you know that the messages are committed????????

Can you do an amqsget and retrieve the messages when the problem occurs with your app that does not retrieve any more messages.



Cheers
KK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top