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 IndexGeneral Discussion3 Write ups on JMS Messages aka MQRFH2

Post new topicReply to topic
3 Write ups on JMS Messages aka MQRFH2 View previous topic :: View next topic
Author Message
RogerLacroix
PostPosted: Thu Apr 12, 2018 9:02 am Post subject: 3 Write ups on JMS Messages aka MQRFH2 Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3072
Location: London, ON Canada

All,

I've been reading different questions regarding issues/problems related to JMS messages (aka MQRFH2 messages) from around the web. So, I have done 3 write ups and posted them to my blog:

(1) JMS (MQRFH2) Message But The User Sees Garbage
http://www.capitalware.com/rl_blog/?p=4786

(2) Handling A JMS (MQRFH2) Message in non-JMS Java Application
http://www.capitalware.com/rl_blog/?p=4811

(3) Creating A JMS (MQRFH2) Message in non-JMS Java Application
http://www.capitalware.com/rl_blog/?p=4823

Hopefully, those blog posting will help people navigate the JMS (aka MQRFH2) message challenges. If there are other JMS message issues then let me know and I'll do more write ups on it (as time permits).

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Thu Apr 12, 2018 1:56 pm Post subject: Reply with quote

Grand Poobah

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

At the risk of starting a controversy, I'd say that if you want to handle the RFH2 header in the message you are already heading down the wrong path.

Use the gmo option MQGMO_GET_PROPERTIES_IN_HANDLE and let the message provide a properties handle you can then use to enumerate the properties on the message.

In the same way on the put create and handle set the properties and pass the properties handle to the put.

Let MQ do the heavy lifting with the alignment needed in the RFH2 header.

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Thu Apr 12, 2018 2:13 pm Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3072
Location: London, ON Canada

Hi,

I don't think you read my blog postings carefully. I said the best solution for using JMS messages is to write the application using IBM MQ classes for JMS.

fjb_saper wrote:
Use the gmo option MQGMO_GET_PROPERTIES_IN_HANDLE and let the message provide a properties handle you can then use to enumerate the properties on the message.

The post 'Handling A JMS (MQRFH2) Message in non-JMS Java Application' shows how to handle a JMS message either using MQRFH2 class or an MQ message with Named Properties.

fjb_saper wrote:
Let MQ do the heavy lifting with the alignment needed in the RFH2 header.

That is the whole point of the MQRFH2 class. MQ library will do everything for you. There is just no good (complete) samples provided by IBM.

fjb_saper wrote:
In the same way on the put create and handle set the properties and pass the properties handle to the put.

True. I didn't show an example of it because I wanted to show MQRFH2 class usage. Besides that style is well documented. But just to close the loop, I'll add a 4th post about it.

Update: The other thing I forgot to mention, when you IBM MQ classes for Java and create an MQ message with Named Properties using set***Property methods, MQ will create an MQRFH message WITHOUT 'mcd' and 'jms' folders. I have seen some JMS applications reject this type of message because it is not a complete "JMS message".

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Thu Apr 12, 2018 7:56 pm Post subject: Reply with quote

Grand Poobah

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

RogerLacroix wrote:

Update: The other thing I forgot to mention, when you IBM MQ classes for Java and create an MQ message with Named Properties using set***Property methods, MQ will create an MQRFH message WITHOUT 'mcd' and 'jms' folders. I have seen some JMS applications reject this type of message because it is not a complete "JMS message".

Regards,
Roger Lacroix
Capitalware Inc.

I thought you'd be able to create those (mcd and jms folders) as properties, just the same way they show up as properties when you use properties in handle... Are you saying that is not possible?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Thu Apr 12, 2018 9:11 pm Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3072
Location: London, ON Canada

fjb_saper wrote:
I thought you'd be able to create those (mcd and jms folders) as properties, just the same way they show up as properties when you use properties in handle... Are you saying that is not possible?

Again, that is not what I wrote. I said that they would not be created. i.e. The 'mcd' and 'jms' folders would be missing by default. The code would have to explicitly added to them which most people don't realize.

Creating an MQ Message with Named Properties as follows:

Code:
MQMessage sendmsg = new MQMessage();
sendmsg.format = CMQC.MQFMT_STRING;
sendmsg.setStringProperty("SomeText", "TEST");
sendmsg.setIntProperty("SomeNum", 123);
sendmsg.writeString("This is a test message.");
queue.put(sendmsg, pmo);

Does not make it a JMS message that all J2EE applications will accept. That was my point.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral Discussion3 Write ups on JMS Messages aka MQRFH2
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.