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 » Not able to read message from MQ local Queue.

Post new topic  Reply to topic
 Not able to read message from MQ local Queue. « View previous topic :: View next topic » 
Author Message
purohit_manoj
PostPosted: Mon Jan 05, 2004 1:36 am    Post subject: Not able to read message from MQ local Queue. Reply with quote

Newbie

Joined: 05 Jan 2004
Posts: 3
Location: Singapore

Hi All Experts,
I am using MQ Series, I have created a local queue on the system. This is a production system where everything was ok until recently something new is discovered. I saw that I am able to browse the message from the Q but I am not able to read the mesage from the queue sometimes. It doesnt happen all the time, its just sometimes.
MQMessage message = new MQMessage();
I m using message.readUTF(); is it got to do with this?
What can be the reason? Pls advice.


Manoj Purohit.
_________________
Brainbench Top 5 Programmers in Singapore.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon Jan 05, 2004 5:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

How do you know it is failing, even sometimes?

Is your code returning an error? Why didn't you post that error, if so? Did you look up in the manuals what that error means?

What do your messages look like? How can we tell whether "readUTF" is the problem or not? Why do you think readUTF might be the problem?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Jan 05, 2004 8:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

When you say 'read the message', I take that to mean that you can't get the message? If that is the case, the most common problem that we see in this area is issuing a get by message id or correlation id and not resetting the field.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
purohit_manoj
PostPosted: Tue Jan 06, 2004 7:14 pm    Post subject: Reply with quote

Newbie

Joined: 05 Jan 2004
Posts: 3
Location: Singapore

I am trying to get the message after browsing the message from the queue. Following is the code snipplet..

MQMessage msg = q_mgr.browseMessage(res_q, false);
if (m_engine == null) break;
if (msg!=null)
{
try
{
String res_string = msg.readUTF();
if (res_string!=null && res_string.length()>0)
{
//This part is not executed. I can go and check that there is a message in the queue by running MQ commands.
//Some code here
}
//Some Code here
}
catch()
{//code here}
}

I am not calling msg.clearMessage() can that be a cause??

bower5932: Thanks for ur reply. Can u pls explain what do u mean by "not resetting the field."

Thanks,
Manoj
_________________
Brainbench Top 5 Programmers in Singapore.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Jan 07, 2004 5:22 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

purohit_manoj wrote:
I am trying to get the message after browsing the message from the queue. Following is the code snipplet..

MQMessage msg = q_mgr.browseMessage(res_q, false);
How do you know the browseMessage call is succeeding? What happens if this piece of code throws an exception?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
purohit_manoj
PostPosted: Wed Jan 07, 2004 7:39 am    Post subject: Reply with quote

Newbie

Joined: 05 Jan 2004
Posts: 3
Location: Singapore

I have some print statement after the browse message and its printing that.
Thanks all for the help, the problem has been solved now.
Actually it had nothing to do with all this.
Thanks for all the valuable advise.

Manoj.
_________________
Brainbench Top 5 Programmers in Singapore.
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Wed Jan 07, 2004 8:17 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

My "resetting the field" comment referred to when you attempt to get a message by ID. In C, the message id/correlation id is filled in after the MQGET. A common mistake was to turn right around and issue a second MQGET using the filled in version of the message id/correlation id. The fields needed to be reset (set to null) so that a second get would get any message and not a specific message (which you had just gotten).
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Not able to read message from MQ local 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.