11.3. XPath を使用したコンテンツベースのルーティングのインラインルールの定義
手順11.1 タスク
jboss-esb.xmlを開き、 cbrAlias プロパティーをXPathに設定します。- 以下に示すように、(コンテナー宛先プロパティーにある)route-to 設定でルーティングルールを定義します。
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter"> <property name="cbrAlias" value="XPath"/> <property name="destinations"> <route-to service-category="BlueTeam" service-name="GoBlue" expression="/Order[@statusCode='0']" /> <route-to service-category="RedTeam" service-name="GoRed" expression="/Order[@statusCode='1']" /> <route-to service-category="GreenTeam" service-name="GoGreen" expression="/Order[@statusCode='2']" /> </property> </action>