Author |
Message
|
Huph |
Posted: Sat Sep 11, 2004 4:06 am Post subject: ApplOriginData with JMS |
|
|
Newbie
Joined: 11 Sep 2004 Posts: 3
|
Hi,
I have communication between a native MQ Client and a JMS client. The native Client is sending data with a set ApplOriginData field. On the JMS-Client is set up a listener (MDB) with a selector: ApplOriginData='xxx'.
Problem: The MDB just reads the messages when I remove the selector.
Same the other way: The JMS-Sender sends a Property ApplOriginData='xxx', the native-Client doesn't recognize it.
Seems to be a Problem with the MQMD Header...
Any tips? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 11, 2004 12:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Can you post your message selector ?
Have you browsed messages and displayed the value of the field ?
Was it what you expected ?
Enjoy |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Sep 13, 2004 5:37 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Can you also post your JMS code that sets the property? Are you trying to create fields in the <usr> folder or are you trying to manipulate the underlying MQMD fields? |
|
Back to top |
|
 |
Huph |
Posted: Tue Sep 14, 2004 3:15 pm Post subject: |
|
|
Newbie
Joined: 11 Sep 2004 Posts: 3
|
My message selector looks like ApplOriginData LIKE 'XML%'.
Using the trace utility from mq I see that the native MQ Application has properly set the ApplOriginData in the MQMD. With another native MQ app I can even read it.
In my JMS Receiver I log all the properties which are set. No ApplOriginData appears there. I expected that it is mapped from the MQMD to a property in JMS.
I set the property like this:
jmsMessage.setStringProperty("ApplOriginData", param.getApplOriginData());
Expecting that it is mapped to the ApplOriginData-Field in the MQMD Header based on the name. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 15, 2004 12:47 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You do realize of course that your selector not being set on one of the standard fields (like group, messageid, correlid) will be VERY VERYslow !!
I would analyse the messages using a browser and display the results of:
Code: |
jmsMessage.getStringProperty("applOriginData"); |
just to make sure you get what you expect... |
|
Back to top |
|
 |
Huph |
Posted: Fri Sep 17, 2004 12:58 pm Post subject: |
|
|
Newbie
Joined: 11 Sep 2004 Posts: 3
|
Analyse the message was the first I did! Outcome:
- If applOriginData is set by JMS and read by JMS everything works fine.
- If applOriginData is set and read by nativeMQ everything works fine.
- Mixed cases don't work.
--> Does this mean applOriginData is not tranlated between JMS and native MQ? Or what am I doing wrong?
What do you mean with standard field? Do you mean MQMD-Fields? If yes then: ApplOriginData is in the MQMD-Block. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Sep 17, 2004 7:19 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
When you use native MQ API the ApplOriginData field is stored in the Message Descriptor header (MQMD).
When you use JMS the ApplOriginData field is stored in the usr folder of the RFH2 header.
Hopefully, that helps.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 18, 2004 1:12 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I believe if you are using a mixed case JMS to a queue for targetclient non JMS your application id is hard coded by IBM to something like java or Websphere etc...
You will have no choice in this unless your non JMS application can and will interpret the RFH2 header (thus having a target client =JMS). See the manual using java for the different mappings (RFH2/MQMD) and which one takes precedence...
Enjoy  |
|
Back to top |
|
 |
RogerLacroix |
Posted: Sat Sep 18, 2004 3:09 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
If you try to set the ApplOriginData field from JMS, you will not get the desired results.
Code: |
jmsMessage.setStringProperty("ApplOriginData", "AAA"); |
The setStringProperty() method does NOT set the MQMD ApplOriginData field but rather just adds a field to the usr folder.
i.e.
Code: |
<usr><ApplOriginData>AAA</ApplOriginData></usr> |
If the QCF has the TARGQ attribute set to JMS (1) then the RFH2 header will set with the message and a native MQ program could parse through the RFH2 header to find the usr folder and then the ApplOriginData field.
But if the QCF has the TARGQ attribute set to MQ (0) then the RFH2 header will NOT be generated for the message. Hence, the usr folder will NOT be generated, and of course, the JMS set ApplOriginData field will be lost.
A nice catch 22!!!
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|