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 » Send RFH2 message from JMS Example (with usr tags)

Post new topic  Reply to topic Goto page Previous  1, 2
 Send RFH2 message from JMS Example (with usr tags) « View previous topic :: View next topic » 
Author Message
espin
PostPosted: Fri Feb 18, 2011 7:25 am    Post subject: Reply with quote

Newbie

Joined: 17 Feb 2011
Posts: 9

My code:
Code:

      outQueue = queueSession.createQueue(channelProperties.getMqOut());
      ((JmsDestination)outQueue).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);

        ((JmsDestination)outQueue).setIntProperty(WMQConstants.WMQ_TARGET_CLIENT,WMQConstants.WMQ_CLIENT_NONJMS_MQ);
    //  ((JmsDestination)outQueue).setBooleanProperty(WMQConstants.WMQ_TARGET_CLIENT_MATCHING,true);
Back to top
View user's profile Send private message
espin
PostPosted: Fri Feb 18, 2011 7:52 am    Post subject: Reply with quote

Newbie

Joined: 17 Feb 2011
Posts: 9

Hi gentleman again! +)

First of all thank you very much for your help and assistance.
As I could understand you there are no problem to implement the message with RHF2 header using native java methods. Ok, probably no difficulties with that approach...

But, unfortunately, I would like to do this using JMS...
The IBM documentation says that it is possible...
I can't see why the IBM's library doesn't allow this +(

It will be very appreciate if some one from you give me the example (part of code) of java code which able to send the massage with RHF2 header.

Thank you, guys.

PS
Please, excuse my for my english... I am foreigner speaker and english isn't my native language.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Feb 18, 2011 7:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you have explicitly set the targetClient as fjb_saper has said, then at the MQ v6 level, the message *will* have an MQRFH2 on it.

At MQv7, the JMSMessage will be mapped differently, to a message that has MQ v7 Message Properties on it. These messages can be turned into messages that have MQRFH2 headers on them when they move to a v6 environment. So this may explain what you are seeing - the message has properties but not an RHF2. But the data is still contained in the message.

But any application that is using JMS to read these messages will receive 'the right' thing.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Feb 18, 2011 8:00 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

espin wrote:
As I could understand you there are no problem to implement the message with RHF2 header using native java methods.


No, I said the exact opposite. I said to use JMS, and there are any number of JMS examples on the web. Including the one posted earlier in this thread for your assistance.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
espin
PostPosted: Fri Feb 18, 2011 8:16 am    Post subject: Reply with quote

Newbie

Joined: 17 Feb 2011
Posts: 9

mqjeff, Vitor, thanks a lot!

I would like to take a pause in our discussion and try locating the examples in earlier posts.

Thanks all of you for your help!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 18, 2011 2:41 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:
((JmsDestination)outQueue).setIntProperty(WMQConstants.WMQ_TARGET_CLIENT,WMQConstants.WMQ_CLIENT_NONJMS_MQ);

By using the WMQ_CLIENT_NONJMS_MQ constant you tell the system to suppress your RFH header.
You need to set the constant to WMQ_CLIENT_JMS or its equivalent!

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
espin
PostPosted: Mon Feb 21, 2011 12:05 am    Post subject: Reply with quote

Newbie

Joined: 17 Feb 2011
Posts: 9

Hi, fjb_saper!

I have changed the constant according your recommendation:

Code:
    ((JmsDestination)outQueue).setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);   ((JmsDestination)outQueue).setIntProperty(WMQConstants.WMQ_TARGET_CLIENT,WMQConstants.WMQ_CLIENT_JMS_COMPLIANT);


and miracle was arrived at my home!!!
The problem with messages having the RFH2 header was disappeared at all!

Special thanks to fjb_saper for extremely clear explanation.

The question is closed +)
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 21, 2011 5:08 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

espin wrote:
The problem with messages having the RFH2 header was disappeared at all!


Leaving you with the problem of all the non-MQMD JMS information disappearing.

But if it works for you...

If your problem was that you didn't want an RFH2, why were you so insistent on an example of setting the <usr> tags in an RFH2?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Feb 21, 2011 7:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Vitor wrote:
espin wrote:
The problem with messages having the RFH2 header was disappeared at all!


Leaving you with the problem of all the non-MQMD JMS information disappearing.

But if it works for you...

If your problem was that you didn't want an RFH2, why were you so insistent on an example of setting the <usr> tags in an RFH2?


Take into account his poor mastery of the English language.
I am sure he meant to say:
The problem with messages not having the expected RFH2 header was solved.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Feb 21, 2011 7:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fjb_saper wrote:
Take into account his poor mastery of the English language.


Oh, I'm happy with any solution that meets the OP's requirements. Big fan of things working I am.

Simply trying to get my head round the situation & reassure myself I was answering the question asked and not what I thought was being asked.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Send RFH2 message from JMS Example (with usr tags)
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.