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 » Writing XML document to MQQueue

Post new topic  Reply to topic
 Writing XML document to MQQueue « View previous topic :: View next topic » 
Author Message
kpatel0122
PostPosted: Wed Oct 08, 2003 4:46 pm    Post subject: Writing XML document to MQQueue Reply with quote

Newbie

Joined: 08 Oct 2003
Posts: 3

I use the following Java Code to write to a Queue, the problem i encounter is that, the message, once its written to the queue has extra characters "Rc" in it. Can anybody help me solve this.
Thank you
keyur

public static void write(byte[] b) throws MQException {
MQQueue queue = queueManager.accessQueue( outputQName,
getOpenOptions(), null, null, null);
MQPutMessageOptions putOptions = new MQPutMessageOptions();
putOptions.options = MQC.MQPMO_FAIL_IF_QUIESCING;
MQMessage message = new MQMessage();
try {
message.writeUTF(new String(b));
queue.put(message, putOptions);
message.clearMessage();
}
catch (MQException e) {
System.out.println("Error while writing to the queue: " + e.getMessage());
}
}
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Oct 09, 2003 6:17 am    Post subject: Reply with quote

Jedi Knight

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

Shouldn't you be using

Code:
message.writeString(new String(b));


instead of
Code:
message.writeUTF(new String(b));


-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kpatel0122
PostPosted: Thu Oct 09, 2003 7:47 am    Post subject: Reply with quote

Newbie

Joined: 08 Oct 2003
Posts: 3

while using writeString(new String(b)) i need ot format the message
say message.format = MQC.MQFMT_STRING;
and the result is the same
without using a formatted message causes an error - missing MQSTR from the message
Back to top
View user's profile Send private message
kpatel0122
PostPosted: Thu Oct 09, 2003 8:34 am    Post subject: Reply with quote

Newbie

Joined: 08 Oct 2003
Posts: 3

rather using writeString(String) causes the error that missing MQSTR from teh message...
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 » Writing XML document to MQQueue
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.