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 » ReadUTF() problem

Post new topic  Reply to topic
 ReadUTF() problem « View previous topic :: View next topic » 
Author Message
Srinivasavs
PostPosted: Wed Aug 27, 2003 4:38 am    Post subject: ReadUTF() problem Reply with quote

Newbie

Joined: 27 Aug 2003
Posts: 5

Hi,

i am having a Java agent which is trying to get the messages from a Queue and create documents in Domino.

I am able to get the messages but they are truncated.

Here is the code.

String msgText = new String();
.
.
MQQueue mqQ = qMgr.accessQueue(mqQname, openOptions); .
.
mqQ.get(retrievedMessage,gmo);
msgText = retrievedMessage.readUTF();



Are there any know problems with readUTF(). Is there any limitation on the number of characters that it will return? If so how can I overcome that problem and get the full mesage instead of truncated message?

Thanks in advance
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
vennela
PostPosted: Wed Aug 27, 2003 5:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Srinivas:

Use readString method like this.

Code:

mqQ.get(retrievedMessage,gmo);
int msgLength = retrievedMessage.getMessageLength() ;

String msgText = retrievedMessage.readString(msgLength);



-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Srinivasavs
PostPosted: Thu Aug 28, 2003 12:13 am    Post subject: Reply with quote

Newbie

Joined: 27 Aug 2003
Posts: 5

Thanks for the reply..

It works. But if there is an "enter"/new line in the message. the message is getting truncated. Any solutions?

Thanks again
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
EddieA
PostPosted: Thu Aug 28, 2003 6:08 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

MQ won't truncate the message.

My guess is that some code processing the message after retreival thinks that a cr/lf is the end of the data.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Aug 28, 2003 7:31 am    Post subject: Reply with quote

Jedi Knight

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

You can use the amqsbcg sample program to confirm what the messages are on the queue. It will help point out where the CRLF is getting misplaced.
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 » ReadUTF() problem
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.