|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Why NO parsing errors with extra fields (MRM TDS)? |
« View previous topic :: View next topic » |
Author |
Message
|
Ramphart |
Posted: Thu Aug 12, 2004 4:32 am Post subject: Why NO parsing errors with extra fields (MRM TDS)? |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
- I'm using WMQI 2.1 CSD 07 on Windows 2000.
- I'm trying to create a Message Set with a TDS layer to model the following
Input Message 1
NameA,SurnameA,20,Mr<CR><LF>
NameB,SurnameB,22,Mrs<CR><LF>
NameC,SurnameC,24,Miss<CR><LF>
Message Set Structure
-Message ([Ordered Set,Closed] TDS: 'DES' = All elements delimited - 'Delimiter' = <CR><LF> )
--Msg ([Ordered Set,Closed] TDS: 'DES' = All elements delimited - 'Delimiter' = , )
----Name (String)
----Surname (String)
----Age (String)
----Title (String)
Results when testing
-Using Input Message 1 - (i.e. Correct message)
(0x1000021) (0x1000021)MRM = (
(0x1000013)Msg = (
(0x300000B)Name = 'NameA'
(0x300000B)Surname = 'SurnameA'
(0x300000B)Age = '20'
(0x300000B)Title = 'Mr'
)
(0x1000013)Msg = (
(0x300000B)Name = 'NameB'
(0x300000B)Surname = 'SurnameB'
(0x300000B)Age = '22'
(0x300000B)Title = 'Mrs'
)
(0x1000013)Msg = (
(0x300000B)Name = 'NameC'
(0x300000B)Surname = 'SurnameC'
(0x300000B)Age = '24'
(0x300000B)Title = 'Miss'
)
)
All good so far
-Using Input Message 2 - (i.e. INcorrect message - extra fields on each line ...)
NameA,SurnameA,20,Mr,ExtraField1,ExtraField2<CR><LF>
NameB,SurnameB,22,Mrs,ExtraField1,ExtraField2<CR><LF>
NameC,SurnameC,24,Miss,ExtraField1,ExtraField2<CR><LF>
(0x1000021)MRM = (
(0x1000013)Msg = (
(0x300000B)Name = 'NameA'
(0x300000B)Surname = 'SurnameA'
(0x300000B)Age = '20'
(0x300000B)Title = 'Mr,ExtraField1,ExtraField2'
)
(0x1000013)Msg = (
(0x300000B)Name = 'NameB'
(0x300000B)Surname = 'SurnameB'
(0x300000B)Age = '22'
(0x300000B)Title = 'Mrs,ExtraField1,ExtraField2'
)
(0x1000013)Msg = (
(0x300000B)Name = 'NameC'
(0x300000B)Surname = 'SurnameC'
(0x300000B)Age = '24'
(0x300000B)Title = 'Miss,ExtraField1,ExtraField2'
)
)
HELP HELP HELP
-The Message Domain, Message set, Message Type and Message Format is set on the Input Node
-Validation is set on the input node to "Content and Value"
-I expected a parsing exception when submitting message 2 (with extra fields) but none occurred
-All extra data are stuffed into my last field (Title)
-Is there a reason why message 2 parse successfully although it is erroneous? _________________ Applications Architect |
|
Back to top |
|
 |
shanson |
Posted: Thu Aug 12, 2004 5:50 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
You are tripping over a behavioural feature of the TDS parser in All Elements Delimited mode. After reading the last delimiter, the delimiter is considered finished with, and the parser no longer considers it when reading the bitstream. Therefore any subsequent occurrences of the delimiter will be read as data, since it is no longer reserved.
Switching on validation makes no difference, as validation only kicks in once the message has been parsed to create the logical message tree. Given that the field in question is a string with no further constraints on it, the value passes. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Aug 12, 2004 6:08 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So, if he switches to "variable elements delimited" will that fix his problem? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
shanson |
Posted: Thu Aug 12, 2004 7:57 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
As the message format stands, I don't think it will help because the last field 'Title' is not fixed length (it can be Mr or Mrs). However if it is possible to put the 'Age' field last with a fixed length of 2, then VLED might well give an error if extraneous data was present. Worth a try  |
|
Back to top |
|
 |
Ramphart |
Posted: Thu Aug 12, 2004 9:43 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
This sucks man The order of the fields are fixed so I can't go the route to have the integer field at the end of the record.
I hope this works a bit better in WBIMB 5.0. Does it ? _________________ Applications Architect |
|
Back to top |
|
 |
shanson |
Posted: Fri Aug 13, 2004 12:08 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
No.
I think you can work round this though using validation.
- If the allowable values of 'Title' are fixed at Mr, Mrs, etc, then you can define enumeration value constraints.
- If it is not fixed you can define a pattern value constraint - use a regular expression that disallows the comma.
- If there a maximum length for the value, define a length value constraint.
With validation switched on, any violation of the constraints you specify will cause an exception. |
|
Back to top |
|
 |
Ramphart |
Posted: Fri Aug 13, 2004 3:15 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
|
Thx a million Shanon. The data pattern or maxlength suggestion will definitely resolve this issue. You're a star. _________________ Applications Architect |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|