Answered by:
Routing based on keyword

Question
-
I have to route the message based on keyword or expression available in the message. For example if the file contains expression "This should go to A" then the file should be routed to location A. How can this be achieved in an optimal way? ThanksFriday, October 9, 2009 6:37 AM
Answers
-
Hi,
Routing can only be done on promoted properties. This means you will have to find a way to promote a value to the context in order to have send ports or orchestrations pick up the message using a filter.
Since you have to enter a distinct value to filter on in a send port or orchestration you should choose a fixed set of values for promotion. If the keywords or expressions you mention are not a fixed set of values you need to write some logic to make sure they are. This could be done in a custom pipeline component. The PC looks for a keyword or expression and translates that to a value in fixed set of values. Finally you promote a property with this new value or let this be done by another pipeline component down the stream.
HTH, Randal van Splunteren - http://biztalkmessages.vansplunteren.net - Please mark as answered if this answers your question.- Proposed as answer by Tariq Majeed Friday, October 9, 2009 2:02 PM
- Marked as answer by Andrew_ZhuModerator Friday, October 16, 2009 2:19 AM
Friday, October 9, 2009 7:31 AMModerator
All replies
-
Hi,
Routing can only be done on promoted properties. This means you will have to find a way to promote a value to the context in order to have send ports or orchestrations pick up the message using a filter.
Since you have to enter a distinct value to filter on in a send port or orchestration you should choose a fixed set of values for promotion. If the keywords or expressions you mention are not a fixed set of values you need to write some logic to make sure they are. This could be done in a custom pipeline component. The PC looks for a keyword or expression and translates that to a value in fixed set of values. Finally you promote a property with this new value or let this be done by another pipeline component down the stream.
HTH, Randal van Splunteren - http://biztalkmessages.vansplunteren.net - Please mark as answered if this answers your question.- Proposed as answer by Tariq Majeed Friday, October 9, 2009 2:02 PM
- Marked as answer by Andrew_ZhuModerator Friday, October 16, 2009 2:19 AM
Friday, October 9, 2009 7:31 AMModerator -
Thanks for your reply. Since the messages being used are SWIFT based promotion of properties at the schema level is not possible. Can I load the entire message in the orchestration and use Regex for expression search then dynamically route the message?Friday, October 9, 2009 7:55 AM
-
Promoting the properties in the schema changes the schema but that change is just the metadata about the property which is promoted. The change won't have any effect on your solution you just have to redeploy it. Promoting the property in the schema and then routing it based on the value of the property is the best optimal solution for routing.
If still you don't plan to change your schema for promoting properties you have to use orchestration to route your message which I would say will go against the architecture of BizTalk.
Abdul Rafay http://abdulrafaysbiztalk.wordpress.com/ Please mark this as answer if it helpsFriday, October 9, 2009 1:30 PM