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!

Exception when performing get on MQSeriesETD (4.5.3)

Status
Not open for further replies.

akiraYoshi

Programmer
May 26, 2004
3
DE
I'm using MQSeries natively on a queue that contains message groups flagged with a correlationid that indicates the receiver of the message.
When performing a getWithOptions, I end up with an Exception "MQJE001: Beendigungscode 2, Ursache 2033", when the queue has no matching messages.

Checking on getCurrentDepth() has no effect, as the queue almost always contains messages with different correlationids. But with an empty queue this works...

Event try'ing the get results in the same Exception message in the eway's stderr logfile. I'd like to test whether the queue has matching entries before performing a get, so I can be sure it will work without Exception.

I would appreciate any idea, the mqseries documentation itself didn't provide any useful hint...

Thanks in advance, Aki

The Queue "initialization" looks as follows:

Code:
  getinQueue().getqueueAccessOptions().optionsClearAll();
  getinQueue().getqueueAccessOptions().setMQOO_INQUIRE(true);
  getinQueue().getqueueAccessOptions().setMQOO_INPUT_SHARED(true);
  getinQueue().accessQueue(inQueuename);
  getinQueue().getQueue().getGMO().setMQGMO_SYNCPOINT(true);
  getinQueue().getQueue().getGMO().setMQGMO_LOGICAL_ORDER(true);
  getinQueue().getQueue().getGMO().setMQMO_MATCH_CORREL_ID(true);


This is the actual get:
Code:
  getinQueue().getQueue().newMessage();
  getinQueue().getQueue().getMessage().getMsgHeader().setCorrelationId(correlationbytes);
  getinQueue().getQueue().getWithOptions();
  getinQueue().getQueue().getMessage().getMsgBody().readData();
  payload=getinQueue().getQueue().getMessage().getMsgBody().getData();
 
We had a similar problem of the exception being thrown when the queue is empty, to resolve the problem we did this:

catch(CollabConnException cce)
{
if (!cce.getMessage().equals( "getWithOptions threw exception: MQRC_NO_MSG_AVAILABLE" ))
{
EGate.collabFatal(">>> Caught CollabConnException that is not MQRC_NO_MSG_AVAILABLE. About to re-throw the Exception");

throw (cce);
}
else
{
}
}


YOu can probably catch your exception in much the same way and let the rule continue to run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top