Version 5

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

    -


    Pattern Description

     

     

    A recipient list inspects an incoming message, determines the list of desired recipients, and forwards the message to all channels associated with the recipients in the list.

     

    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="recipientlistCategory1" service-name="regularService"></route-to>
            <route-to destination-name="extra"  service-category="recipientlistCategory2"  service-name="ExtraStaticListener"></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="recipientlistCategory1" service-name="regularService" ></route-to>
            <route-to service-category="recipientlistCategory4" service-name="extraService1" ></route-to>
            <route-to service-category="recipientlistCategory5" service-name="extraService2" ></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 adn object-path of "body.order".

     

    More information