Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to receive message correctly

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I am new to MQSeries. Trying my Servlet to put a message into a queue. I am able to put the message. But while extracting it I find that the first character is nothing, second is " ", and the first character of the actual (sent)message is the third character in the received message.

I have declared the options as follows:

MQMessage sendMsg = new MQMessage();
sendMsg.writeUTF("<msg>Hello from Sheila!</msg>");
sendMsg.format = MQC.MQFMT_STRING;

MQPutMessageOptions pmo = new MQPutMessageOptions(); pmo.options = 98;
sendMsg.messageType = 1;
sendMsg.report = 0;
sendMsg.replyToQueueName = "RESPONSE_QUEUE";
sendMsg.replyToQueueManagerName = m_qManager;
sendMsg.priority = 0;
sendMsg.expiry = -1;

m_system_default_local_queue.put(sendMsg, pmo);

Could you please help me ?
TIA,
Sheila
 
I figured it out. Instead of

sendMsg.writeUTF("<....");

I needed to write

sendMsg.writeString("<....");

Thanks,
Sheila
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top