activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkozic <drazen.ko...@asw.eu>
Subject Ending choice().when() block
Date Thu, 23 Oct 2008 11:50:55 GMT

Hi there,

Can anybody explain to me how to end choice().when() block in Java DSL.

In Spring configuration it clearly demarcated

<from uri="sourceURL"/>
<to uri ="uriA"/>
    <choice>
      <when>
        <simple>header.foo = 'bar'</simple>
        <to uri="Target1"/>
      </when>
      <otherwise>
        <to uri="Target2"/>
      </otherwise>
    </choice>
<to uri="uriB"/>

>From this configuration it is clear that  uriB will be "executed" after
choice. So possible message flow is:
1. sourceURL -> uriA -> Target1 -> uriB
or
2. sourceURL -> uriA -> Target2 -> uriB

How to achieve this in Java DSL? It is not clear where otherwise block ends.
For instance:
from("sourceURL").to("uriA").choice().
         when().simple("header.foo = 'bar'").to("Target1").
         otherwise().to("Target2").to("uriB")

I found end() method in RouteBuilder, but I can not find any documentation
about that.

Thanks in advance
-- 
View this message in context: http://www.nabble.com/Ending-choice%28%29.when%28%29-block-tp20129377p20129377.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message