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 » sending message containing embedded MQMD using MQJava

Post new topic  Reply to topic
 sending message containing embedded MQMD using MQJava « View previous topic :: View next topic » 
Author Message
longhorn
PostPosted: Thu May 22, 2014 6:19 am    Post subject: sending message containing embedded MQMD using MQJava Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu May 22, 2014 7:43 am    Post subject: Re: sending message containing embedded MQMD using MQJava Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
longhorn
PostPosted: Thu May 22, 2014 8:04 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu May 22, 2014 9:04 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
longhorn
PostPosted: Thu May 22, 2014 10:06 am    Post subject: Reply with quote

Novice

Joined: 22 May 2014
Posts: 14

Sounds like it's not that straightforward...
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 22, 2014 10:30 am    Post subject: Reply with quote

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
View user's profile Send private message
longhorn
PostPosted: Thu May 22, 2014 11:37 am    Post subject: Reply with quote

Novice

Joined: 22 May 2014
Posts: 14

Thanks. That's what I needed to know.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu May 22, 2014 3:35 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
longhorn
PostPosted: Fri May 23, 2014 12:22 am    Post subject: Reply with quote

Novice

Joined: 22 May 2014
Posts: 14

Thanks for the tip, that's kind of what I was thinking.
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 » sending message containing embedded MQMD using MQJava
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.