Author |
Message
|
mqsha |
Posted: Tue Jan 24, 2006 3:04 pm Post subject: can't read the XML message |
|
|
Novice
Joined: 10 Jun 2004 Posts: 17
|
Hi,
I am using INPUTnode -> Filter Node-> Output Node
|--> Output Node(Error Queue)
I am using message domain as BLOB, messages are getting with XML and String messages .
I am using Correlation iD in the message ,
substring(cast(Root.MQMD.CorrelId as CHARACTER ccsid 437) from 1 for 5) >= 80000 AND substring(cast(Root.MQMD.CorrelId as CHARACTER ccsid 437) from 1 for 5) <= 84999
I want the message if the correclationID is between 80000 and 84999, no matter whether its XML or string message.
Can any one suggest me what i am doing wrong.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 24, 2006 3:40 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You mean, besides trying to use the defined-as-binary-only correlation ID to hold string data? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Tue Jan 24, 2006 4:53 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
You can't make a greater-than (<) and equal to (=) comparison between a string and a numeric value. They have to be on the same playing field. |
|
Back to top |
|
 |
mqsha |
Posted: Tue Jan 24, 2006 6:26 pm Post subject: |
|
|
Novice
Joined: 10 Jun 2004 Posts: 17
|
yes.. how can i convert Correlation ID (HEX) to Integer. because we are using JMS ,correlatioID is like integer. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 24, 2006 6:32 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
JT wrote: |
You can't make a greater-than (<) and equal to (=) comparison between a string and a numeric value. They have to be on the same playing field. |
I suspect, not having double-checked, that this is a case where an implicit conversion takes place. It's definitely legal (I checked) to use <= and >= with CHAR operands.
Regardless, it's likely that the original correlation ID is being set to a value in Unicode - which is being recorded as byte values with no CCSID - and then mqsha is trying to convert that to CCSID 437.
mqsha - DO NOT USE CORRELATION ID FOR THIS.
Use a JMS Property, maybe. You can get at JMS properties from within WMB/WBIMB/WMQI in the MQRFH2 header. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 25, 2006 1:52 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqsha wrote: |
yes.. how can i convert Correlation ID (HEX) to Integer. because we are using JMS ,correlatioID is like integer. |
WRONG whether you are using JMS or any other API the Correlation id is always a byte array and not a number. JMS may give you a char representation of the byte array but this does not change anything to the underlying structure.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hal |
Posted: Mon Jan 30, 2006 3:08 pm Post subject: |
|
|
Acolyte
Joined: 07 Dec 2005 Posts: 67 Location: New York City, New York
|
Not sure why the correlation id field is being used for this purpose, but in ESQL you can cast a hex/BLOB value to an integer and then compare the result to other integers. For example, in a filter node:
DECLARE correlidChar CHARACTER;
SET correlidChar = substring(
CAST(Root.MQMD.CorrelId AS CHARACTER ccsid 437)
FROM 1 FOR 5);
DECLARE correlidInt INTEGER;
SET correlidInt = CAST(correlidChar AS INTEGER);
IF (correlidInt >= 80000) AND (correlidInt <= 84999) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF; |
|
Back to top |
|
 |
|