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 » unable to get the message from the queue completely

Post new topic  Reply to topic
 unable to get the message from the queue completely « View previous topic :: View next topic » 
Author Message
asr2002
PostPosted: Mon Oct 28, 2002 9:41 am    Post subject: unable to get the message from the queue completely Reply with quote

Novice

Joined: 09 Sep 2002
Posts: 13

Hi guys!!!
i put a message in a queue and get the message using the message id... so i need to browse and then get the message... below code is working fine, ie. i'm able to browse and get the requied message and output the message, but i'm unable to get the message completely from the queue once it is found.... my question is , do i need to set any gmo or pmo options to get the message from the queue...
i really appreciate ur inputs...
Thanks



MQMessage retrievedMessage = new MQMessage();
byte[] rMsgId1 = new byte[24];
String rMsgId = new String(sMsgId);
rMsgId1 = rMsgId.getBytes();
retrievedMessage.clearMessage();
retrievedMessage.correlationId = MQC.MQCI_NONE;
retrievedMessage.messageId = MQC.MQMI_NONE;
retrievedMessage.messageId = rMsgId1;

// Set the get message options...

MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;
//gmo.matchOptions = MQC.MQMO_MATCH_MSG_ID;

// get the message off the queue...
getQueue.get(retrievedMessage, gmo);
// String sMsg = retrievedMessage.readString(retrievedMessage.getMessageLength());
sMsg = retrievedMessage.readString(retrievedMessage.getMessageLength());

// String msgText = retrievedMessage.readUTF();
System.out.println("The Get Message is: " + sMsg);
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;

// Close the queue...
getQueue.close();
} catch (MQException mqe) {
System.out.println(mqe.getMessage());
}
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Oct 28, 2002 4:03 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

What error code is MQ returning to you when you try to get the message?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
asr2002
PostPosted: Tue Oct 29, 2002 8:16 pm    Post subject: Reply with quote

Novice

Joined: 09 Sep 2002
Posts: 13

sorry, for confusion... i'm not saying i'm getting an error... actually my question is say when i have 10 messages in a queue, i need to get the required msg based on msgid... so what i do is i browse and get the particular msg... but what is happening is i'm able to print my get msg, but it is not delteing in the queue... some now it is working now i used options :MQC.MQGMO_MSG_UNDER_CURSOR

thanks, for ur response
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue Oct 29, 2002 11:10 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

If you know what message you're looking for beforehand, why even do the browse? If you are matching on message id, just use this as the matching parameter in the gmo options and do a regular MQGET. This should both find the message you desire and remove it from the queue.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » unable to get the message from the queue completely
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.