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 API Support » Getting added some character in front of a message

Post new topic  Reply to topic
 Getting added some character in front of a message « View previous topic :: View next topic » 
Author Message
jeevan
PostPosted: Wed Jul 14, 2010 7:11 pm    Post subject: Getting added some character in front of a message Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

I am writing a small app on base java api for MQ. I need to put the message in order to test the listner is working. Tivoli can test whether it is listening or not but it can not test whether it is functioning ( responding the request). The app is intended to test the listening is functioning by putting message and checking it replies.

The code snippet is as follows:


Quote:


// Set up the options on the queue we wish to open...

int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT|MQC.MQOO_INQUIRE;


MQQueue requestQueue = requestQMgr.accessQueue(requestQueueName, openOptions);

// Define a simple MQSeries message, and write some text in UTF format..
//MQMessage hello_world = new MQMessage();
MQMessage requestMsg = new MQMessage();

requestMsg.replyToQueueManagerName = "TESTQMGR";

requestMsg.replyToQueueName = "TEST.QUEUE";

//hello_world.writeUTF("Hello World!");
requestMsg.format =MQC.MQFMT_STRING;
requestMsg.writeUTF("AXXXddddddddddddddd ddddddd dddddddd ");

// specifythe message options...
MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same as MQPMO_DEFAULT


// put the message on the queue
//system_default_local_queue.put(hello_world,pmo);
requestQueue.put(requestMsg,pmo);


I am not getting a reply. when I checked the message on the queue after stoppign the listener, I saw that there is "A" added in front of the message.

But when I put the message using amqsput, i can not see "A" in front of the text. Could some of you please help me figure this out why ?

[/quote]
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 14, 2010 7:50 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You used writeUTF. This goes in pair with readUTF. It adds/strips the order byte info in front of the message.

If you want to use a text message just specify MQSC.MQFMT_STRING in the format field and use the write method. Do not use the writeUTF method...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jeevan
PostPosted: Thu Jul 15, 2010 4:07 am    Post subject: Reply with quote

Grand Master

Joined: 12 Nov 2005
Posts: 1432

fjb_saper wrote:
You used writeUTF. This goes in pair with readUTF. It adds/strips the order byte info in front of the message.

If you want to use a text message just specify MQSC.MQFMT_STRING in the format field and use the write method. Do not use the writeUTF method...

Have fun


I chagned to writeString method and it worked. Thanks a lot fjb_saper
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 API Support » Getting added some character in front of a 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.