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 Modeling

Post new topic  Reply to topic
 Message Modeling « View previous topic :: View next topic » 
Author Message
SpitFire
PostPosted: Fri Apr 07, 2006 4:04 am    Post subject: Message Modeling Reply with quote

Acolyte

Joined: 01 Aug 2005
Posts: 59
Location: India

Hi all,
I have a scenario in which the message flow picks up an XML(self-defining or MRM.XML) message, and then does thorough validation on the incoming data and then routes it some other destination for processing. The issue I'm facing is that the flow can receive upto 93 msgs. The structure of the msgs are more or less the same. The difference in the msgs are based on the value of a particular field viz., action or messageid(basically, either a string description or a number). Depending upon the value extra fields may appear/disappear in the message structure. For example, look at the following two sample msgs...

---* Sample Message: #1 *---
--------------------------------------------------
<msgs>
<action>ALERT</action>
...
<alertMsg>... General Warning ...</alertMsg>
...
</msgs>
--------------------------------------------------

---* Sample Message: #2 *---
--------------------------------------------------
<msgs>
<action>ALERT_RESPONSE</action>
...
<fault>
<code>FAULT-#1</code>
<reason>FALSE ALARM</reason>
</fault>
...
</msgs>
--------------------------------------------------

In the example shown above, the msgs are differentiated only based on the value of the 'action' element. And after classifying the same, I ahve to do content based validation on the msgs viz., ensure for msgs of type 'ALERT_RESPONSE', fault->code is set.

How do I begin modeling for such a scenario?

Should I develop individual msgs for each such msg, though their structures would more or less be the same? In that case, the validation becomes easier. However, I would end up wasting time defining same elements repeatedly for each of the msgs. On the other hand, if in case I choose to develop a single message pattern, how do I set and validate the conditions for checking the message payload later?
_________________
...: 5|71+ph1|23 :...
Back to top
View user's profile Send private message
thomeck
PostPosted: Fri Apr 07, 2006 5:32 am    Post subject: Reply with quote

Apprentice

Joined: 07 Apr 2006
Posts: 30
Location: Germany

Hi,

I think you have to define a DTD for your xml like

<!DOCTYPE msgs[
<!ELEMENT msgs(action, alertMsg, fault)>
<!ELEMENT action (#PCDATA)>
<!ELEMENT alertMsg (#PCDATA)>
<!ELEMENT fault(code, reason)>
<!ELEMENT code (#PCDATA)>
<!ELEMENT reason (#PCDATA)>
]>

This DTD must include all possible attributes. But be sure that it is not well-formed if an attribute is not in your xml data.

I had test it with ICS it works.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Apr 07, 2006 6:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Should I develop individual msgs for each such msg
It depends. Your validation requirements are outside of what XML Schema allows. There are products out there which do this kind of cross-field validation, but the current version of the broker does not support it. I think you have two choices:

a) Implement a two-stage message flow in which you inspect InputRoot.XML.msgs and then re-parse and validate ( using an RCD node) using message definition N ( where N is between 0 and 92 ).
b) Skip schema validation entirely. Code the validation rules in ESQL and just take the maintenance hit.

If you want higher performance, option a) could be done within a single Compute node using CREATE FIELD...PARSE to do the reparsing and validation.
Which option you take depends on how many validation rules there are, and whether you can summarise them in some efficient and maintainable ESQL.
Back to top
View user's profile Send private message
SpitFire
PostPosted: Tue Apr 11, 2006 2:13 am    Post subject: Reply with quote

Acolyte

Joined: 01 Aug 2005
Posts: 59
Location: India

Hi thomeck,
Thanks for the response. However, I guess your solution won't work in my case.
IMHO, DTD's are used to model XML instances and are too document oriented, in the sense they can't possible be used to define data-types of the elements or impose restrictions on the range of values that the elements can handle.
"...XML Schemas provide data-oriented data types in addition to the more document-oriented data types XML DTDs support..." - http://www.techinterviews.com/?p=203
I think, I need to use only an xml schema and then import the same into the broker to generate the msg-sets.
_________________
...: 5|71+ph1|23 :...
Back to top
View user's profile Send private message
SpitFire
PostPosted: Tue Apr 11, 2006 2:15 am    Post subject: Reply with quote

Acolyte

Joined: 01 Aug 2005
Posts: 59
Location: India

kimbert wrote:

I think you have two choices:
a) Implement a two-stage message flow in which you inspect InputRoot.XML.msgs and then re-parse and validate ( using an RCD node) using message definition N ( where N is between 0 and 92 ).
b) Skip schema validation entirely. Code the validation rules in ESQL and just take the maintenance hit.

I'm taking the first one. And, thanks for the information.
_________________
...: 5|71+ph1|23 :...
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 Modeling
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.