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 Java / JMS » Getting 2033 error in GetMessage of reply queue

Post new topic  This topic is locked: you cannot edit posts or make replies.
 Getting 2033 error in GetMessage of reply queue « View previous topic :: View next topic » 
Author Message
anuj1992
PostPosted: Mon Sep 05, 2016 6:20 am    Post subject: Getting 2033 error in GetMessage of reply queue Reply with quote

Newbie

Joined: 05 Sep 2016
Posts: 2

I have to send and receive message with MQ I am able to send and receive message with MQ Explorer.

In MQ Explorer, we created two different queue managers for request and reply on different different ports.

But when I use to connect with Java code in Getmessage I am getting Error code 2033 while get message.


Code:
import java.io.IOException;
import java.util.Arrays;

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

public class MQSapmle {
   
   private String hostname = "[HostName]";
   private String channel  = "[RequestChannel_Name]";
   private String qManager = "[QueueManagerName]";
   private MQQueueManager qMgr;

   public void init()
   {
      MQEnvironment.channel  = channel;
      MQEnvironment.port = 1417;
      MQEnvironment.userID = "mqm";
      MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);
   } // end of init

   public void start() throws Exception
   {
      try {
         // Create a connection to the queue manager
         qMgr = new MQQueueManager(qManager);

         int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;

         // Now specify the queue that we wish to open, and the open options...

         MQQueue system_default_local_queue = qMgr.accessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE", openOptions,null,"in",null);

         String Assoc = "test message";

         MQMessage request = new MQMessage();
         request.writeUTF(Assoc);
         request.replyToQueueManagerName="mgr_beta_reply";
         request.replyToQueueName="4560";

         MQPutMessageOptions pmo = new MQPutMessageOptions();
         system_default_local_queue.put(request,pmo);

         MQMessage retrievedMessage = new MQMessage();
         retrievedMessage.messageId = request.messageId;
         // Getting Message Id Here returns Message ID
         System.out.println("Recieved ID: "+ Arrays.toString(retrievedMessage.messageId));

         MQGetMessageOptions gmo = new MQGetMessageOptions();
         system_default_local_queue.get(retrievedMessage, gmo);

         String msgText = retrievedMessage.readUTF();
         System.out.println("The message is: " + msgText);

         System.out.println("Is Connection: "+ qMgr.isConnected);

         qMgr.disconnect();
      }
      catch (MQException ex)
      {
         System.out.println("An MQSeries error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
      }
      catch (java.io.IOException ex)
      {
         System.out.println("An error occurred whilst writing to themessage buffer: " + ex);
      }
   } // end of start
}
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Sep 05, 2016 6:45 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Please do not double post. It just annoys the amongst us.

As for your error.

Did you bother to look up what 2033 actually means?

the command line can help

Code:

mqrc 2033


Once you understand what it means you can start to understand why you are getting it.

There are literally dozens of posts here about this reason code which is not always an error by the way.

Oh, and please do not use any SYSTEM.* queue for anything from an application (yes there are exceptions but in general use using these queues is a No-No.).

The Google search option in the upper right of the screen is the place to start searching.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 05, 2016 8:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20695
Location: LI,NY

Locked as duplicate of http://www.mqseries.net/phpBB2/viewtopic.php?t=72914
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  This topic is locked: you cannot edit posts or make replies. Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Getting 2033 error in GetMessage of reply queue
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.