Author |
Message
|
dajaykumar_ms |
Posted: Mon May 15, 2006 4:58 am Post subject: CorrelID type error in a JMS Sub Flow |
|
|
Newbie
Joined: 18 Apr 2006 Posts: 6 Location: India
|
Hi All,
I'm new to WMB and hence apologies for any elementary mistakes. I'm using the new JMS Pub/Sub support featured in Message Broker 6. I have issues trying to setup a simple subscribe flow. The flow can be roughly represented pictorially as follows:
JMSInput => JMSMQTransform => Compute Node => MQPut
The problem I face is that, after the compute node, the Correl ID is populated by an empty string. This causes the MQPut to fail, since CorrelID is expected to be of BLOB type. I used the Debug Trace facility while deployment to analyse this.
I tried the following things
1. Set the Compute Mode property of compute node to "Local Environment and Messages"
2. Set the OutputRoot.MQMD.CorrelId to NULL so as to delete it
3. Set the OutputRoot.MQMD.CorrelId to a fixed BLOB value
All these efforts produced the same result. I did setup a trace node right after JMSMQTransform. It seems that there is no CorrelID field there. How come this field mysteriously appears in the compute node is baffling me. Kindly advice.
Regards
Ajay |
|
Back to top |
|
 |
fwsld |
Posted: Thu Jul 13, 2006 5:40 am Post subject: Re: CorrelID type error in a JMS Sub Flow |
|
|
Newbie
Joined: 13 Jul 2006 Posts: 5
|
dajaykumar_ms wrote: |
Hi All,
I'm new to WMB and hence apologies for any elementary mistakes. I'm using the new JMS Pub/Sub support featured in Message Broker 6. I have issues trying to setup a simple subscribe flow. The flow can be roughly represented pictorially as follows:
JMSInput => JMSMQTransform => Compute Node => MQPut
The problem I face is that, after the compute node, the Correl ID is populated by an empty string. This causes the MQPut to fail, since CorrelID is expected to be of BLOB type. I used the Debug Trace facility while deployment to analyse this.
I tried the following things
1. Set the Compute Mode property of compute node to "Local Environment and Messages"
2. Set the OutputRoot.MQMD.CorrelId to NULL so as to delete it
3. Set the OutputRoot.MQMD.CorrelId to a fixed BLOB value
All these efforts produced the same result. I did setup a trace node right after JMSMQTransform. It seems that there is no CorrelID field there. How come this field mysteriously appears in the compute node is baffling me. Kindly advice.
Regards
Ajay |
I have noticed the same behaviour however. If instead of going to a compute node I have the JMSMQTransform node going straight to an MQOutput Node then it works fine.
JMSin - Transform - MQoutput
Any one have any idea what is going on here? Is this a bug of some sort I cant seem to find much information regarding this.
Cheers
Luke |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 13, 2006 2:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well you may remember the difference in methods on JMS
getJMSCorrelationId and getJMSCorrelationIdAsBytes.
If you are not carefull you might ending up moving a string to a bytearray (BLOB). Not a smart move!
If you deal with MQJMS forget the value in the RFH and move the value from the MQMD. If dealing with a foreign JMS you're on your own.
And when clearing the value use MQMI_NONE!
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
fwsld |
Posted: Fri Jul 14, 2006 3:29 am Post subject: |
|
|
Newbie
Joined: 13 Jul 2006 Posts: 5
|
fjb_saper wrote: |
Well you may remember the difference in methods on JMS
getJMSCorrelationId and getJMSCorrelationIdAsBytes.
If you are not carefull you might ending up moving a string to a bytearray (BLOB). Not a smart move!
If you deal with MQJMS forget the value in the RFH and move the value from the MQMD. If dealing with a foreign JMS you're on your own.
And when clearing the value use MQMI_NONE!
Enjoy  |
I dont think this is the issue as it works using the JMSMQtransform node as long as you dont alter the message. I tried using a compute copying outputroot from inputroot and it still works. However if I copy the headers and change the format of the body it does not work. Nothing is touching the CorrelId in this process. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 14, 2006 5:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
2. Set the OutputRoot.MQMD.CorrelId to NULL so as to delete it |
Note this part. This is not the way to clear the correlation id.
Try
Code: |
SET OutputRoot.MQMD.CorrelId = MQMI_NONE; |
This would give you the right length for the byte array filled with hex 00.
This should avoid the problem on the put.
That problem probably is caused by point 2.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
voodoo123 |
Posted: Mon Aug 14, 2006 6:47 am Post subject: |
|
|
Newbie
Joined: 14 Aug 2006 Posts: 5
|
Use this statement first
SET OutputRoot = InputRoot;
Then remove all the unwanted elements
and add the rest.
It is working |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 14, 2006 7:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Better to copy message headers and then only copy needed elements from InputRoot to OutputRoot. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
voodoo123 |
Posted: Mon Aug 14, 2006 7:09 am Post subject: |
|
|
Newbie
Joined: 14 Aug 2006 Posts: 5
|
Example code for tranformation in Compute node I had used.
SET OutputRoot = InputRoot;
SET OutputRoot.MQMD.Expiry = MQEI_UNLIMITED;
SET OutputRoot.MQMD.Persistence = MQPER_PERSISTENT;
SET OutputRoot.Properties.MessageDomain = 'BLOB';
SET OutputRoot.XMLNS = null;
SET OutputRoot."BLOB"."BLOB" = BITSTREAM(InputBody);
Copying the headers and properties separately and setting the message body causes the same CorrelId issue. |
|
Back to top |
|
 |
voodoo123 |
Posted: Thu Aug 17, 2006 1:51 am Post subject: ReplyProtocol |
|
|
Newbie
Joined: 14 Aug 2006 Posts: 5
|
I think I have found out the exact reason for this behaviour.
This is to do with the 'ReplyProtocol' field in the MQMD header.
When the message comes out of a JMSMQTranform node 'ReplyProtocol' is set to 'JMS'. If we do not touch the header (do SET OutputRoot = InputRoot), this value remains the same. But if we loop through the header or assign them separately, the value changes to 'MQ'. I tried setting it back in Compute node. But it does not work.
So the real issue is how to maintain the 'ReplyProtocol' at MQPUT as 'JMS'.
There is another interesting thing.
If a ResetcontentDescriptor is used when 'ReplyProtocol' is 'JMS' it can not recogonize the 'Properties' folder. So it needs a header copying such that the value chnages to 'MQ'.
Can someone please look into this behaviour? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 17, 2006 2:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well you have to remember how JMSCorrelationId works exactly in MQ.
The JMSCorrelationId gets first stored in the RFH header. If the length is less or equal to 24 bytes it will get transferred to the MQMD for its byte values and be completed with hex 00 values.
If the JMSCorrelationId is longer than 24 bytes (hex display on 48 char + "ID:" see ID:xxxxxxx) than the system will troncate the JMSCorrelationId at it's first 24 bytes and use those in the MQMD. If this is the case you will see a difference between the JMSCorrelationId and the MQMD Correlation Id in the length (# of bytes) with the JMSCorrelationId having more than 24 bytes.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Aug 18, 2006 3:18 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi guys,
A not so beautiful workaround seems to be the addition of a JMStoMQ transform right before putting the message into the output queue.
Regards. |
|
Back to top |
|
 |
|