ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message getting parsed even for invalid data :

Post new topic  Reply to topic
 Message getting parsed even for invalid data : « View previous topic :: View next topic » 
Author Message
yshakraj
PostPosted: Thu Jul 05, 2012 6:16 am    Post subject: Message getting parsed even for invalid data : Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

Hi,
I created a message set with message containing two segments,each segment has fields delimited by '|' and has a Group indicator D and T for first and sec segments respectively.for eg. 'Dabc|def|gh||xy|***EOR***'
each segment ends with '***EOR***' as in above eg.
I have 10 fields in the first segment whish must be delimited by 9 '|'s and termintaed by ***EOR***. when i'm trying to parse against invalid data,skipping few '|'s, even then it's parsing.so please help me fix this problem and tell me a way to fail parsing when data skipping required number of '|' is posted.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 05, 2012 6:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

What does the user trace show you? If you believe the message set does not describe the data being received, what does the trace tell you about how the broker parsed the data & resolved this paradox?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
yshakraj
PostPosted: Thu Jul 05, 2012 7:08 am    Post subject: Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

Message Set is not for fixed length data and hence takes into the field.For example,if the data required is abc|def||. but am sending abcdef| then abcdef gets parsed to first field.If one of the field is missing it has to be '||' which tells field value is null.So it's the number of |'s that tell the message has to be parsed or not
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 05, 2012 7:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

yshakraj wrote:
Message Set is not for fixed length data and hence takes into the field.


I got the lack of fixed data from the fact you have the fields delimited.

yshakraj wrote:
For example,if the data required is abc|def||. but am sending abcdef| then abcdef gets parsed to first field.If one of the field is missing it has to be '||' which tells field value is null.


Exactly my point. If your message set requires 3 fields so "abc|def||' is valid but "abcdef|" is not, what does the user trace say about why the broker is not worried about the last 2 fields being missing in the invalid example?

yshakraj wrote:
So it's the number of |'s that tell the message has to be parsed or not


No it isn't. The message will be parsed if it's a string of random hex.

What tell broker the message is correct is likewise not the number of | characters but the number of mandatory fields which are present. In your case these happen to be delimited by | but broker doesn't care.

You have 3 fields in your example. You want all 3 to be present in your message even if one of them is null. You need to describe that in your message set. Trace will tell you what broker thinks the message set is describing, which is clearly different to what you think it's describing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 05, 2012 7:26 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Here's another interesting question - how are you telling WMB to reject invalid messages with fields missing? Do you actually use validation or is there a mechanism in your code? Because (for example) if your code only references the 1st field WMB may not notice the others are missing unless you tell it to check.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jul 05, 2012 2:19 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
please help me fix this problem and tell me a way to fail parsing when data skipping required number of '|' is posted.
You can achieve what you want like this:
- enable validation in your message flow. You can do that by setting the 'Validation' property to 'Content and Value' on the input node.
- set minOccurs to 1 for all 10 fields in your record

There is another way, although possibly not an option for you. Upgrade to WMB v8 and replace your MRM message set with a DFDL schema. DFDL explicitly supports the concept of required delimiters via the separatorPolicy property.
Back to top
View user's profile Send private message
yshakraj
PostPosted: Thu Jul 05, 2012 11:12 pm    Post subject: Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

I tried with data and content validation set on but it's failing to parse data Dabc||ghi|jkl....,
the fields can be null which should be specified by '||' .

how to implement default value as null and also field is mandatory.......
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jul 06, 2012 12:35 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

So, you have two problems
a) how to detect missing fields. We've answered that one
b) how to tolerate empty delimited fields when validation is enabled.

The answer to b) is here: http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ad06830_.htm
Back to top
View user's profile Send private message
yshakraj
PostPosted: Sat Jul 07, 2012 12:46 am    Post subject: Reply with quote

Voyager

Joined: 14 Sep 2011
Posts: 91

kimbert ..thanks alot..it worked...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message getting parsed even for invalid data :
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.