Hi all,
In the current ESB implementation we have couple of mediators for message
routing. While 'Filter' and 'Switch' mediators provide basic level of
message filtering, router mediator is also doing very similar to what
filter/switch mediators do. The usage of Router mediator is rare and often
got replaced by filter/switch mediators. So, IMO, Router Mediator is
redundant, unless it provides some advance/complex routing logic support.
In the ESB 4.0.0 release, we introduces 'Conditional Router', which is
intended to route messages based on HTTP headers, query parameters and url.
However, this doesn't support routing based on message payload. But unlike
'Router', the 'Conditional Router' introduces uses the concepts of
'Evaluators' (And, Or, Match, Equal, Not) that can be utilize to construct
complex routing logics.
eg:
<conditionalRouter continueAfter="false">
<conditionalRoute breakRoute="false">
<condition>
<and xmlns="">
<match type="header"
source="my_custom_header1" regex="foo.*"/>
<match type="url"
regex="/services/StockQuoteProxy.*"/>
</and>
</condition>
<target sequence="cnd2_seq"/>
</conditionalRoute>
<conditionalRoute breakRoute="false">
<condition>
<and xmlns="">
<match type="header"
source="my_custom_header2" regex="bar.*"/>
<equal type="param" source="qparam1"
value="qpv_foo"/>
<or>
<match type="url"
regex="/services/StockQuoteProxy.*"/>
<match type="header"
source="my_custom_header3" regex="foo.*"/>
</or>
<not>
<equal type="param" source="qparam2"
value="qpv_bar"/>
</not>
</and>
</condition>
<target sequence="cnd3_seq"/>
</conditionalRoute>
</conditionalRouter>
So, we can easily add message level routing capability(so that we can drop
Router mediator) to Conditional Router and with that we'll get the power of
using evaluators for message level routing as well. Having bunch of
mediators that's doing the similar thing, cause a negative effect on ESB's
usability.
(Most of the pointed listed here, were discussed during last code-review of
Group-D.)
*
*
[1] http://wso2.org/project/esb/java/4.0.0/docs/mediator_guide.html
Thanks,
--
Kasun Indrasiri
Associate Technical Lead
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware
cell: +94 71 536 4128
Blog : http://kasunpanorama.blogspot.com/
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev