2 Replies Latest reply on Jan 16, 2012 3:21 AM by Jochen Lauer

    Java DSL vs. Spring DSL

    Jochen Lauer Apprentice

      Hello,

       

      I got a problem converting a route from spring dsl into java dsl.

       

      <camelContext xmlns="http://camel.apache.org/schema/spring">
          <route>
              <from uri="jms:topic:test"></from>
              <choice>
                  <when>
                      <xpath>//xml/t1</xpath>
                           <split>
                            <xpath>/xml/t1/test</xpath>
                               <to uri="log:1"></to>
                        </split>
                  </when>
                  <when>
                      <xpath>//xml/t2</xpath>
                           <split>
                            <xpath>/xml/t2/tset</xpath>
                            <to uri="log:2"></to> 
                        </split>
                  </when>
                  <otherwise>
                      <to uri="log:Invalid"></to>
                  </otherwise>
              </choice>
          </route>
      </camelContext>
      

       

      I expected a java dsl route like

       

      from("jms:topic:test")
      .choice()
             .when(xpath("//xml/t1"))
                       .split(xpath("/xml/t1/test"))
                           .to("log:1")    
             .when(xpath("//xml/t2"))
                      .split(xpath("/xml/t2/tset"))
                           .to("log:2")            
                  .otherwise()
                      .to("log:Invalid");
      

       

      but I failed with ...... a lot of possible versions.

       

      Is there a limitation in java dsl ?

       

      Thanks

      labo