Author |
Message
|
nhanks |
Posted: Thu Apr 15, 2004 11:33 am Post subject: multiple message types per MQInput node supported? |
|
|
Novice
Joined: 18 Dec 2001 Posts: 13
|
My MQInput node receives fixed-length messages - no delimiters. However, each message is a different structure.
For example I might receive msg 1 which looks like:
field1(8 chars in length)field2(2 chars in length)field3....
Then I might receive msg 2 which looks like:
field1(10 chars in length)field2(4 chars in length)field3....
I have modeled each of the different messages using the MRM parser and with either the TDS or CWF physical model.
However, unless I specifically indicate the exact message type on the MQInput node, parsing fails with an error of:
CWF Error : Unknown message type
The CWF parser or writer has received an unknown message type identifier in the message properties.
The specified message set ('OV4SLH0002001') does not contain a message type with this identifier.
In summary, I need to be able to support multiple message types with the MQInput node and I am not sure how to do this.
Thanks in advance.[/i] |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 15, 2004 11:37 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to add an RFH2 header to each of your messages, and include in that header the information that tells the MQInput node which MRM formats to use.
Then, in your code, you need to do something to identify which message format has been used to parse the incoming data so that you are accessing the correct thing. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Lisa |
Posted: Thu Apr 15, 2004 11:48 am Post subject: Multi Format |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Or,
You can read the message in as a BLOB, Use a Compute node and search for a value in position X, use RouteToLabel for final processing.
Depending on where the data is coming from, the sender may not want to add RFH2 header!
Lisa |
|
Back to top |
|
 |
nhanks |
Posted: Thu Apr 15, 2004 1:00 pm Post subject: |
|
|
Novice
Joined: 18 Dec 2001 Posts: 13
|
If I use the BLOB method will I need to convert from Hex back to ASCII strings so that I can do normal string comparisons, etc?
If so, how do I do this? Is there something in ESQL that allows for this? |
|
Back to top |
|
 |
Lisa |
Posted: Thu Apr 15, 2004 1:16 pm Post subject: messages |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
You can use something like this:
If Cast(substring(InputBody."BLOB" from 21 for 3) as CHAR CCSID InputRoot.MQMD.CodedCharSetId) = '599' Then
Set myroute = '599';
Else
.....
Lisa |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 15, 2004 4:41 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
nhanks wrote: |
If I use the BLOB method will I need to convert from Hex back to ASCII strings so that I can do normal string comparisons, etc? |
Not necessarily. The various string functions work just fine on BLOB data. But when you are comparing values, you have to compare BLOB values. So any fixed constants you are comparing with have to be expressed as Hex values (or converted to Hex/BLOB values using a CAST first). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|