|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Writing XML document to MQQueue |
« View previous topic :: View next topic » |
Author |
Message
|
kpatel0122 |
Posted: Wed Oct 08, 2003 4:46 pm Post subject: Writing XML document to MQQueue |
|
|
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 |
|
 |
vennela |
Posted: Thu Oct 09, 2003 6:17 am Post subject: |
|
|
 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 |
|
 |
kpatel0122 |
Posted: Thu Oct 09, 2003 7:47 am Post subject: |
|
|
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 |
|
 |
kpatel0122 |
Posted: Thu Oct 09, 2003 8:34 am Post subject: |
|
|
Newbie
Joined: 08 Oct 2003 Posts: 3
|
rather using writeString(String) causes the error that missing MQSTR from teh message... |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|