Author |
Message
|
longhorn |
Posted: Thu May 22, 2014 6:19 am Post subject: sending message containing embedded MQMD using MQJava |
|
|
Novice
Joined: 22 May 2014 Posts: 14
|
Hi,
Is it possible to send a message (saved with rfhutil including headers) to a queue using MQJava classes? I have written a simple java program and I can send the message to the queue but the headers appear as part of the body. Do I need to set some put message options?
Code: |
......
MQMessage tstMsg = new MQMessage();
reqMsg.writeString(<fileConvertedToString>);
destQ.put(tstMsg);
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 22, 2014 7:43 am Post subject: Re: sending message containing embedded MQMD using MQJava |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
longhorn wrote: |
Hi,
Is it possible to send a message (saved with rfhutil including headers) to a queue using MQJava classes? I have written a simple java program and I can send the message to the queue but the headers appear as part of the body. Do I need to set some put message options?
Code: |
......
MQMessage tstMsg = new MQMessage();
reqMsg.writeString(<fileConvertedToString>);
destQ.put(tstMsg);
|
|
Why don't you use RFHUtil to put the messages back onto the queue?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
longhorn |
Posted: Thu May 22, 2014 8:04 am Post subject: |
|
|
Novice
Joined: 22 May 2014 Posts: 14
|
I know I can do that, I am just looking to see if it's possible to use the MQ Java classes to write the message to a queue. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 22, 2014 9:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
longhorn wrote: |
I know I can do that, I am just looking to see if it's possible to use the MQ Java classes to write the message to a queue. |
It is possible. Have fun writing it though...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
longhorn |
Posted: Thu May 22, 2014 10:06 am Post subject: |
|
|
Novice
Joined: 22 May 2014 Posts: 14
|
Sounds like it's not that straightforward... |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 22, 2014 10:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
longhorn wrote: |
Sounds like it's not that straightforward... |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
longhorn |
Posted: Thu May 22, 2014 11:37 am Post subject: |
|
|
Novice
Joined: 22 May 2014 Posts: 14
|
Thanks. That's what I needed to know. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 22, 2014 3:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need the pmo options "setAll" and you need to parse the header fields from the file and set them on the message. After that you can get to the chained headers (if there are any) and at last the payload...
Like I said, have fun writing it...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
longhorn |
Posted: Fri May 23, 2014 12:22 am Post subject: |
|
|
Novice
Joined: 22 May 2014 Posts: 14
|
Thanks for the tip, that's kind of what I was thinking. |
|
Back to top |
|
 |
|