Version 10

    JBossESB - JBossESBEIP - Wiretap (inc. both Static and Content Based Routing)

    -


    Pattern Description

     

    A wiretap implements a fixed Recipient List with two output channels. It takes a message from the input channel and publishes the message in an unmodified state to both output channels.

     

     

    Implementation

     

    You can plug in other engines but by default we use JBossRules as our evaluation engine. JBossRules is deployed to the ESB by default in the jbrules.esb archive. We use an XPath construct to evaluate XML messages. To use XPath you need to reference the XPathLanguage.dsl.

     

    Configuration

     

    We have both a content based router and a static router.

     

    For the content based router (org.jboss.soa.esb.actions.ContentBasedRouter) the configuration of the action looks like:

     

    ...
    <action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
        <property name="ruleSet" value="MyESBRules-XPath.drl"></property>
        <property name="ruleLanguage" value="XPathLanguage.dsl"></property>
        <property name="ruleReload" value="true"></property>
        <property name="destinations">
            <route-to destination-name="regular" service-category="wiretapCategory1" service-name="regularService"></route-to>
            <route-to destination-name="wiretap"  service-category="wiretapCategory2"  service-name="wiretapService"></route-to>
        </property>
    </action>
    ...
    

     

    For the static router () the configuration of the action looks like this:

     

    ...
    <action name="routeAction"  class="org.jboss.soa.esb.actions.StaticRouter">
        <property name="destinations">
            <route-to service-category="wiretapCategory2" service-name="wiretapService" ></route-to> 
            <route-to service-category="wiretapCategory1" service-name="regularService" ></route-to>  
        </property>
    </action>  
    ...
    

     

    Attribute

    Required

    Description

    ruleSet

    yes

    Reference to the rule set that will be used

    ruleLanguage

    no

    Reference to a Domain Specific Languange, can be XPathLanguage.dsl or your own custom language

    ruleReload

    no

    false by default, if set to true it will hot-deploy updated rules.

    destinations

    yes

    The name should be referenced in the ruleSet, while the service-category and service-name are used to lookup the right EPR in the registry.

    object-paths

    no

    Specifies the place of the object in the message.

     

    Note that JBossRules only deals with 'shallow' objects. So if in your rule you want to inspect an Order object which lives in the body of the message called "order", you will have specify an object-path of "body.order".

     

    More information