[JBoss ESB Development] - Re: XPath Routing
by tfennelly
So what I have now will look like the following....
External rules file:
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
| <property name="cbrClass" value="XPath"/>
| <property name="ruleSet" value="/rules/xpath/order-rules.properties"/>
| <property name="ruleReload" value="true"/>
| <property name="destinations">
| <route-to destination-name="blue" service-category="BlueTeam" service-name="GoBlue" />
| <route-to destination-name="red" service-category="RedTeam" service-name="GoRed" />
| <route-to destination-name="green" service-category="GreenTeam" service-name="GoGreen" />
| </property>
| </action>
Inline rules:
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
| <property name="cbrClass" value="XPath"/>
| <property name="ruleSet">
| <rule destination-name="blue" expression="/order/header[@cat='blue']" />
| <rule destination-name="red" expression="/order/header[@cat='red']" />
| <rule destination-name="green" expression="/order/header[@cat='green']" />
| </property>
| <property name="destinations">
| <route-to destination-name="blue" service-category="BlueTeam" service-name="GoBlue" />
| <route-to destination-name="red" service-category="RedTeam" service-name="GoRed" />
| <route-to destination-name="green" service-category="GreenTeam" service-name="GoGreen" />
| </property>
| </action>
With namespaces:
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
| <property name="cbrClass" value="XPath"/>
| <property name="ruleSet">
| <rule destination-name="blue" expression="/a:order/a:header[@cat='blue']" />
| <rule destination-name="red" expression="/b:order/b:header[@cat='red']" />
| <rule destination-name="green" expression="/c:order/c:header[@cat='green']" />
| </property>
| <property name="namespaces">
| <namespace prefix="a" uri="http://a" />
| <namespace prefix="b" uri="http://b" />
| <namespace prefix="c" uri="http://c" />
| </property>
| <property name="destinations">
| <route-to destination-name="blue" service-category="BlueTeam" service-name="GoBlue" />
| <route-to destination-name="red" service-category="RedTeam" service-name="GoRed" />
| <route-to destination-name="green" service-category="GreenTeam" service-name="GoGreen" />
| </property>
| </action>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4256679#4256679
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4256679
16 years, 6 months
[JBoss ESB Development] - Re: XPath Routing
by tfennelly
"mvecera(a)redhat.com" wrote : Yes, exactly. Here is a sample scenario:
| * A message contains an order. Each order item carries a store code and a weight.
| * For minimizing postage cost, a custom action will compose an XPath query that points to the store code of the heaviest item in the order.
| * CBR will use this query to route the message to the corresponding store for process.
|
| Does it make sense?
I understand what you're proposing, but I don't really see the benefit of it yet.
1. Why can't these routing expressions be defined with the CBR action Vs on the incoming message? What use case would not be supported?
2. If the invoking client is specifying the CBR expression to be used by the CBR, then does it not make the CBR step a bit redundant... why can't the client effectively perform the CBR?
3. From a logic standpoint, it seems to me that the appropriate place for the CBR rules is in/with the CBR action.
4. Security??
Martin, would you be OK with putting this one on the back boiler for now? We can always add it later.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4256675#4256675
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4256675
16 years, 6 months
[JBoss Transactions Development] - Re: Asynchronicity and transaction context propagation
by mark.little@jboss.com
"chtimi2" wrote : Are you referring to the TrCoreProgrammersGuide pdf? I think so (was probably renamed) but just to be sure.
|
Yes.
anonymous wrote :
| As i thought, the check method is passed a list of the active threads.
| If i'm not mistaken, i would just need to implement a BlockingCheckedAction, that calls join() on all those threads, and use it for the global transaction.
|
That should work.
anonymous wrote :
| To sum it up:
| 1/ Launch the server with -Dcom.arjuna.ats.jts.checkedTransactions=YES to enable checked transactions
|
Last time I checked it was on by default.
anonymous wrote :
| 2/ Implement BlockingCheckedAction that does: for (Thread t: list) { t.join() }
| 3/ Just after the global transaction has started i would need to do
| Current current = OTSManager.get_current().
| | current.setCheckedAction ( new BlockingCheckedAction() );
|
|
| I thought of a simple unit test to verify the correctness of the transactional behaviour.
| Do you think this would work? I prefer asking before i start spending time integrating another TransactionManager in Spring.
|
| 1/ UnitTest (UT) calls transactional service void updateXY ( int X , int Y , boolean failOnUpdatingY ) synchronously
| 2/ The global transaction is initiated and updateXY updates X
| 3/ updateXY then calls transactional service updateY ( int Y , boolean failOnUpdatingY ) asynchronously
| 4/ updateY executes within the same global transaction; if (failOnUpdatingY) a RuntimeException is thrown, which must rollback the global transaction
| 5/ UT sleeps for a second, by then the transaction should have been committed or rolled back
| 6/ UT calls getX and getY
| 7/ Verifications:
| Case ! failOnUpdatingY: X and Y should have their new values because the global transaction has been committed
| Case failOnUpdatingY: X and Y should have their old values because the global transaction has been rolled back
|
Assuming you're not looking at distributed invocations here then that looks like it should work (but I haven't put a lot of time into thinking about it.)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4256661#4256661
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4256661
16 years, 6 months