Posted: Tue Jun 27, 2006 9:19 am Post subject: Problem in reading a 12000 character length MQ Message
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 ;
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.
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