Author |
Message
|
saturn_cemk |
Posted: Wed Apr 11, 2007 10:16 pm Post subject: Writing message to queue from file |
|
|
Novice
Joined: 10 Jul 2006 Posts: 16
|
Hi all,
I have a message (containing the headers and body) which is stored in a text file. Now I want to write this message to an MQ queue. For doing this I want to write a small piece of code in java.
I could manage to read the entire file and store it in a String or byte array. But I need to convert the String / byte array to MQMessage before I can write it to the queue without changing the headers.
How can I do this ? Is there any way to convert a String / byte array to MQMessage ?
Any help will be appreciated.
Thank you |
|
Back to top |
|
 |
Michael Dag |
Posted: Thu Apr 12, 2007 12:11 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
|
Back to top |
|
 |
saturn_cemk |
Posted: Thu Apr 12, 2007 3:07 pm Post subject: |
|
|
Novice
Joined: 10 Jul 2006 Posts: 16
|
Thanks for the link Michael. It really helped. |
|
Back to top |
|
 |
EZHIL MALAR |
Posted: Thu Jan 22, 2009 4:00 am Post subject: |
|
|
Newbie
Joined: 20 Mar 2007 Posts: 8
|
saturn_cemk wrote: |
Thanks for the link Michael. It really helped. |
How did you do it????
I have a similar case |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 22, 2009 4:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's exactly as simple as reading the file data, and then writing the bytes from the file into the body of an MQ Message. |
|
Back to top |
|
 |
|