ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Reason Code 2033.

Post new topic  Reply to topic
 Reason Code 2033. « View previous topic :: View next topic » 
Author Message
Sonal
PostPosted: Wed May 06, 2009 10:19 pm    Post subject: Reason Code 2033. Reply with quote

Apprentice

Joined: 20 Mar 2009
Posts: 45

I sent a message from a sender Queue Manager to the receiver Queue Manager using MQ Explorer. I checked if the message has been sent to the receiver queue or not. Message has been sent. When I don't close the browse window in MQ Explorer and try to retrieve the message from receiver queue using Java code, it shows the following error message:

compile:
run-single:
Connecting to queue manager: QM_RREC
Accessing queue: Q1
...and getting the message back again
An IOException occured whilst writing to the message buffer: java.io.EOFException
BUILD SUCCESSFUL (total time: 1 second)


However, if I close the browse window and then try to run the java code to retrieve sent message in receiver queue, it shows the following error:

compile:
run-single:
Connecting to queue manager: QM_RREC
Accessing queue: Q1
...and getting the message back again
A WebSphere MQ Error occured : Completion Code 2 Reason Code 2033
MQJE001: Completion Code 2, Reason 2033
BUILD SUCCESSFUL (total time: 0 seconds)


I checked if the message is present in the receiver queue or not, I couldn't see the message in receiver queue in MQ Explorer

I read the reason 2033. I think its probably due to in MQGMO (the Options and MatchOptions fields). MQGMO_WAIT option was not specified, or the time interval specified by the WaitInterval field in MQGMO has expired.

I tried to specify the MQGMO_WAIT options but I dunno how to speify it. Could you please help me?

The java code im using is as follows:

package mq;

import com.ibm.mq.*; //Include the WebSphere MQ classes for Java package

public class MQSample {


// define the name of the QueueManager
private static final String qManager = "QM_RREC";
// and define the name of the Queue
private static final String qName = "Q1";


// main method: simply call the runSample() method
public static void main(String args[]) {
new MQSample().runSample();
MQEnvironment.disableTracing ();
MQException.log = null;
}

public void runSample() {

try {
// Create a connection to the QueueManager

System.out.println("Connecting to queue manager: "+qManager);
MQQueueManager qMgr = new MQQueueManager(qManager);

// Set up the options on the queue we wish to open
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF ;
//int openOptions = MQC.MQWI_UNLIMITED ;
//int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;
// Now specify the queue that we wish to open and the open options
System.out.println("Accessing queue: "+qName);
MQQueue queue = qMgr.accessQueue(qName, openOptions);


// Now get the message back again. First define a WebSphere MQ message
// to receive the data
MQMessage rcvMessage = new MQMessage();

// Specify default get message options
MQGetMessageOptions gmo = new MQGetMessageOptions();

// Get the message off the queue.
System.out.println("...and getting the message back again");
queue.get(rcvMessage, gmo);

// And display the message text...
String msgText = rcvMessage.readUTF();
System.out.println("The message is: " + msgText);

//Close the queue
System.out.println("Closing the queue");
queue.close();

// Disconnect from the QueueManager
System.out.println("Disconnecting from the Queue Manager");
qMgr.disconnect();
System.out.println("Done!");
}
catch (MQException ex) {
System.out.println("A WebSphere MQ Error occured : Completion Code "
+ ex.completionCode + " Reason Code " + ex.reasonCode);
}
catch (java.io.IOException ex) {
System.out.println("An IOException occured whilst writing to the message buffer: "
+ ex);
}
}
}

Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 06, 2009 11:36 pm    Post subject: Re: Reason Code 2033. Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Sonal wrote:
I checked if the message is present in the receiver queue or not, I couldn't see the message in receiver queue in MQ Explorer


Then nothing you do in the Java is going to make it magically appear.

Sonal wrote:
I tried to specify the MQGMO_WAIT options but I dunno how to speify it. Could you please help me?


Yes - read the Java manual

My lack of Java knowledge is legendary on this forum and it took me 30 seconds to confirm that the wait options are set where I thought they would be set!

Hint - you're trying to use one of the Options when you Get a Message.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Reason Code 2033.
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.