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 » MQ Browse

Post new topic  Reply to topic
 MQ Browse « View previous topic :: View next topic » 
Author Message
masteringmq
PostPosted: Sun Nov 02, 2008 1:46 am    Post subject: MQ Browse Reply with quote

Master

Joined: 20 Oct 2008
Posts: 200

The code below compiles well. I am getting error 2033. I check QM1.RQSTIN and found that the local queue is not empty. Please advice.

public boolean done = false;

qMgr = new MQQueueManager("QM5");
int openOptions = MQC.MQOO_INPUT_EXCLUSIVE | MQC.MQOO_BROWSE;
MQQueue MQ1_RQSTIN = qMgr.accessQueue("QM1.RQSTIN",openOptions);

MQMessage retrievedMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;

do
{

MQ1_RQSTIN.get(retrievedMessage,gmo);
String msg = retrievedMessage.messageId.toString();
System.out.println(msg);
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;

}while(!done);

MQ1_RQSTIN.close();
qMgr.disconnect();
}
catch (MQException ex)
{
done = true;
System.out.println("A WebSphere MQ error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
}
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Nov 02, 2008 2:01 am    Post subject: Reply with quote

Grand High Poobah

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

If the queue's QM1.RQSTIN and you're connected to QM5 how's it supposed to work? Are you trying to read a remote queue (which won't work)?

Assuming that you're trying to read a conventional local queue, how are you checking it's not empty? It sounds like your target message is uncommitted and ineligable to be used, but still shows up on the queue.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Nov 02, 2008 2:01 am    Post subject: Reply with quote

Grand High Poobah

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

If the queue's QM1.RQSTIN and you're connected to QM5 how's it supposed to work? Are you trying to read a remote queue (which won't work)?

Assuming that you're trying to read a conventional local queue, how are you checking it's not empty? It sounds like your target message is uncommitted and ineligable to be used, but still shows up on the queue.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
masteringmq
PostPosted: Sun Nov 02, 2008 2:10 am    Post subject: Reply with quote

Master

Joined: 20 Oct 2008
Posts: 200

QM1.RQSTIN - local queue belonging to the queue manager QM5. In this local queue there is X number of messages. To know if the queue is empty I issue the MQSC command DISPLAY QLOCAL(QM1.RQSTIN) and check the currentdepth. In my case there is 5 messages.
Back to top
View user's profile Send private message
atheek
PostPosted: Sun Nov 02, 2008 2:46 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Do dis qs(QM1.RQSTIN) UNCOM. If you see UNCOM(YES) then the messages in the queue are uncommitted ones. Uncommitted messages wont be able to an application even though it shows up in the queue count
Back to top
View user's profile Send private message
masteringmq
PostPosted: Sun Nov 02, 2008 3:21 am    Post subject: Reply with quote

Master

Joined: 20 Oct 2008
Posts: 200

DIS QS(QM1.RQSTIN) UNCOM
1 : DIS QS(QM1.RQSTIN) UNCOM
AMQ8450: Display queue status details.
QUEUE(QM1.RQSTIN) TYPE(QUEUE)
CURDEPTH(1) UNCOM(NO)
Back to top
View user's profile Send private message
atheek
PostPosted: Sun Nov 02, 2008 4:07 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Reset the matchOptions after each mq get in the loop:

do
{

MQ1_RQSTIN.get(retrievedMessage,gmo);
String msg = retrievedMessage.messageId.toString();
System.out.println(msg);
gmo.matchOptions=MQC.MQMO_NONE;
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;

}while(!done);
Back to top
View user's profile Send private message
masteringmq
PostPosted: Sun Nov 02, 2008 5:09 am    Post subject: Reply with quote

Master

Joined: 20 Oct 2008
Posts: 200

messageId retrieved: B@1cfb549

I did some convertion:

414D5120514D31202020202020202020CDA30D4920002002
Back to top
View user's profile Send private message
atheek
PostPosted: Sun Nov 02, 2008 11:55 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

masteringmq wrote:
messageId retrieved: B@1cfb549

I did some convertion:

414D5120514D31202020202020202020CDA30D4920002002


So what does that mean? Did it solve your 2033 issue?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Nov 02, 2008 12:43 pm    Post subject: Reply with quote

Grand High Poobah

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

I doubt it. Just to be secure I would also clear the msgid and correlid before each get... just set them to MQMI_NONE and MQCI_NONE....
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ Browse
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.