Author |
Message
|
kash3338 |
Posted: Fri Sep 16, 2011 11:14 pm Post subject: MQRFH2 Headers in JMSMQTransform node |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
HI,
We have a scenario where in we have to add JMS Heders to incoming message from File and then publish the message to a Topic. We have our design as below,
FileInput Node --> Compute --> JMSHeaders --> JMSMQTransform --> Publish
The problem that we face here is, we set the Topic details in MQRFH2 headers in the Compute node and later we add few Application Properties in JMSHeader node.
After the JMSMQTransform node, the JMS headers are moved to MQRFH2 headers, but the psc folder is removed. Is this the property of the JMSMQTransform to remove the existing MQRFH2 headers and create new headers? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 17, 2011 5:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you want to keep the RFH header unchanged use the MQOutput node.
You probably sent the message to a Queue destination. If you want the psc set / used you need to use a Topic destination.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kash3338 |
Posted: Sat Sep 17, 2011 7:32 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
fjb_saper wrote: |
If you want to keep the RFH header unchanged use the MQOutput node.
You probably sent the message to a Queue destination. If you want the psc set / used you need to use a Topic destination.  |
I dint get what you suggested. In my design you can see, we have used Topic destination and thats our requirement and we dont want MQOutput node here.
Why is the RFH headers getting reset after the JMSMQTransform node and what should be done to retain them?
This is my flow design,
FileInput Node --> Compute --> JMSHeaders --> JMSMQTransform --> Publish (Topic) |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Sep 18, 2011 4:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kash3338 wrote: |
fjb_saper wrote: |
If you want to keep the RFH header unchanged use the MQOutput node.
You probably sent the message to a Queue destination. If you want the psc set / used you need to use a Topic destination.  |
I dint get what you suggested. In my design you can see, we have used Topic destination and thats our requirement and we dont want MQOutput node here.
Why is the RFH headers getting reset after the JMSMQTransform node and what should be done to retain them?
This is my flow design,
FileInput Node --> Compute --> JMSHeaders --> JMSMQTransform --> Publish (Topic) |
Your design is wrong. You are dealing with the broker's own publish mechanism here. What you should have is:
FileInput-->Compute(adding the RFH header)-->Publish node.
As you are not dealing with an outside JMS provider, all you are doing is just clutter.
If you want to keep your current setup you will need to do following:
FileInput--> Compute-->JMSHeaders --> JMSMQTransform-->Compute(set RFH psc) --> Publish node.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kash3338 |
Posted: Sun Sep 18, 2011 6:04 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
fjb_saper wrote: |
Your design is wrong. You are dealing with the broker's own publish mechanism here. What you should have is:
FileInput-->Compute(adding the RFH header)-->Publish node.
As you are not dealing with an outside JMS provider, all you are doing is just clutter.
Have fun  |
But my requirement is, I need to add JMS Headers to my message before I send to the MQ Queue. Thats the requirement for me. Hence I have added the JMSHeader node and once I do that, I need to have the JMSMQTransform node since I send the message to MQ Queue. |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Sep 18, 2011 6:57 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Could you explain why you need to add JMS Headers to a message before you send it to the WMQ Queue?
Ok, it is a requirement but why?
What purpose does it serve in this case?
fjb_saper is right, your design as it stands does not seem quite right. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kash3338 |
Posted: Sun Sep 18, 2011 7:36 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
smdavies99 wrote: |
Could you explain why you need to add JMS Headers to a message before you send it to the WMQ Queue?
Ok, it is a requirement but why?
What purpose does it serve in this case?
fjb_saper is right, your design as it stands does not seem quite right. |
We send it to another application which actually requires this JMS Headers and its there requirement. Hence we need to send the message with JMS Headers.
In that case, is this design ok and what can be done with the RFH2 headers? |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Sep 18, 2011 9:19 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
To summarise,
1) The destination application is a subscriber to the topic you are publishing to
2) A Published message received by a subscriber will have an RFH2 Header that contains a 'psc' folder with details of the topic.
3) A JMS Message with WMQ as the transport is a normal WMQ Message with a RFH2 Header with the JMS Q details in the 'jms' folder.
Therefore your requirement is that the published message has BOTH the 'psc' and 'jms' folders.
Is this true? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kash3338 |
Posted: Sun Sep 18, 2011 6:08 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
smdavies99 wrote: |
To summarise,
1) The destination application is a subscriber to the topic you are publishing to
2) A Published message received by a subscriber will have an RFH2 Header that contains a 'psc' folder with details of the topic.
3) A JMS Message with WMQ as the transport is a normal WMQ Message with a RFH2 Header with the JMS Q details in the 'jms' folder.
Therefore your requirement is that the published message has BOTH the 'psc' and 'jms' folders.
Is this true? |
yes its correct. I have a published message with MQRFH2 headers which has a jms, psc and usr folder in it. But as I said, I use a JMSHeader node after my compute node and hence my MQRFH2 headers are overwritten after my JMSMQTransform node?
Is this ok for this requirement and if so, what can be done for this? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Sep 18, 2011 6:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Again using the JMSHeader node is just one implementation for the properties. It does not mean that it is a requirement. You need to understand and make the difference between a business requirement and how this requirement is going to be implemented. The JMSHeader node is an implementation that is coherent with a foreign JMS provider. You are dealing with the WMQ provider and could set all the fields and properties you need in a single compute node.
As alternative and already lined out here add before the publish node a compute node setting the psc folder on the RFH.
The behavior you see is as designed.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Sep 18, 2011 9:20 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
kash3338 wrote: |
Is this ok for this requirement and if so, what can be done for this? |
To follow fjb's hint, try to think outside the box just a little bit. Ask yourself what alternatives are there to using the JMSMQ* node?
You have been given the answer. You were 90% of the way there already.
Once thing about broker that it takes a lot of people a long time to realise is that for just about 99% of the things you want to do with broker there is at least two ways of doing it. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
kash3338 |
Posted: Sun Sep 18, 2011 9:29 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
fjb_saper wrote: |
The JMSHeader node is an implementation that is coherent with a foreign JMS provider. You are dealing with the WMQ provider and could set all the fields and properties you need in a single compute node. |
So do you suggest to use ESQL to set the JMS properties instead of using a JMSHeader node? Even in that case, we will require a JMSMQTransform node after the compute node to send to WMQ?
fjb_saper wrote: |
As alternative and already lined out here add before the publish node a compute node setting the psc folder on the RFH. |
Yes this is one way, and the other way we did was to have the flow like this,
FileInput --> JMSHEader --> JMSMQTransform --> COmpute --> Publish
So the same compute node is used to set the topic as well.
Else, we have this design,
FileInput --> Compute --> JMSHEader --> JMSMQTransform --> Publish
and in this, we do not set the topic details in MQRFH2 headers, instead use the OutputRoot.Properties.Topic.
Is there any better way? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Sep 18, 2011 10:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kash3338 wrote: |
fjb_saper wrote: |
The JMSHeader node is an implementation that is coherent with a foreign JMS provider. You are dealing with the WMQ provider and could set all the fields and properties you need in a single compute node. |
So do you suggest to use ESQL to set the JMS properties instead of using a JMSHeader node? Even in that case, we will require a JMSMQTransform node after the compute node to send to WMQ? |
What for? in that case there is no need for any of the JMS nodes.
kash3338 wrote: |
fjb_saper wrote: |
As alternative and already lined out here add before the publish node a compute node setting the psc folder on the RFH. |
Yes this is one way, and the other way we did was to have the flow like this,
FileInput --> JMSHEader --> JMSMQTransform --> COmpute --> Publish
So the same compute node is used to set the topic as well.
Else, we have this design,
FileInput --> Compute --> JMSHEader --> JMSMQTransform --> Publish
and in this, we do not set the topic details in MQRFH2 headers, instead use the OutputRoot.Properties.Topic.
Is there any better way? |
Objection your honor: asked and answered.... sustained...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kash3338 |
Posted: Sun Sep 18, 2011 10:15 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
fjb_saper wrote: |
What for? in that case there is no need for any of the JMS nodes.
|
Can you please be more clear on what your suggestion is? I still dont understand it completely.
Do you suggest me to code the jms headers in ESQL and if so dont I need to ass a JMSMQTransform node? |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Sep 18, 2011 11:35 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
You are creating folders in the RFH2 header using ESQL. Why not finish the job by also creating the 'jms' folders. i.e. doing the same job that the JMSHeader node does.
Then create the MQMD (Which should be done first btw) using ESQL.
The whole thing should not be more than 30 lines of ESQL.
so the steps are.
1) create the MQMD
2) Create the RFH2 Header
3) Link the MQMD to the RFH2 header
4) Populate the MQMD
5) Populate the 'jms' folder in the RFH2 Header
6) Populate the 'psc' folder in the RFH2 Header
There are examples of most (if not all) of this either in this forum or in the Broker samples.
My invoice for $200 is ready. Now where shall I send it?  _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
|