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 » Problem in reading a 12000 character length MQ Message

Post new topic  Reply to topic
 Problem in reading a 12000 character length MQ Message « View previous topic :: View next topic » 
Author Message
anandcochin
PostPosted: Tue Jun 27, 2006 9:19 am    Post subject: Problem in reading a 12000 character length MQ Message Reply with quote

Newbie

Joined: 30 Nov 2005
Posts: 5
Location: Boston

I am trying to read a 12000 character length MQ Message from the MQ Queue. The message contains some line feed and carraige characters.
I want to get the 12000 character message even if it contains any line feed or carriage return in that.

Pasting my code :
----------------------
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_SYNCPOINT | MQC.MQGMO_CONVERT | MQC.MQGMO_ACCEPT_TRUNCATED_MSG ;

MQMessage msg = new MQMessage();
msg.format = MQC.MQFMT_STRING;
msg.encoding = MQC.MQENC_NATIVE;
msg.messageId = msgId;
msg.correlationId = corrlId;
mqQ.get(msg,gmo,12000);

But its not returning me a string of 12000 charcater.

Can anyone help me to correct the problem ?. Why i am not able to read the entire message ?. Is there any other settings to be done ?.

Thanks
Anand
_________________
Aanand Koottiligal
Back to top
View user's profile Send private message Send e-mail
wschutz
PostPosted: Tue Jun 27, 2006 9:25 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

What are you getting back?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
8davitt
PostPosted: Wed Jun 28, 2006 4:01 am    Post subject: Reply with quote

Apprentice

Joined: 06 Feb 2003
Posts: 37
Location: Seated in front of monitor

Please review the MQ Java API.

MQQueue.get( MQMessage message,
MQGetMessageOptions gmo,
int MaxMsgSize)

This returns data up to a maximum of MaxMsgSize. It is not interested in the contents of the data. If there are not 12000 characters available you will only ge what is there. If there are more than 12000 characters you will get an exception.

Then look at using MQMessage.getDataLength() and MQMessage.readFully() variants to extract the actual data itself including LF CR etc.

Refer to Using Java Chapter 9

One final thing is that you could be hitting a known problem IY72849 so make sure you have the latest service for MQ applied.

/s
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem in reading a 12000 character length MQ Message
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.