2 Replies Latest reply on Jan 7, 2016 10:15 AM by onimurasame

    Try Catch blocks get disrupted

    onimurasame

      Hello all!

       

      Well this is my story.

       

      I've been playing around with Jboss Developer Studio to make myself a nice Jboss Fuse project.

       

      First I tried to make a simple Camel Route to consume from a queue transform the data using a Java bean then put it in another queue. As I managed to do that rather nicely, I began to put some exception handling inside my java bean and then the problem now I'm facing is that I can't seem to handle that in the camel route.

       

      I searched around and I came with this answer:

       

      <route>
          <from uri="direct:start"/>
          <!-- here the try starts. its a try .. catch .. finally just as regular java code -->
          <doTry>
              <process ref="processorFail"/>
              <to uri="mock:result"/>
              <doCatch>
                  <!-- catch multiple exceptions -->
                  <exception>java.io.IOException</exception>
                  <exception>java.lang.IllegalStateException</exception>
                  <to uri="mock:catch"/>
              </doCatch>
              <doFinally>
                  <to uri="mock:finally"/>
              </doFinally>
          </doTry>
      </route>

      So after I nicely copied and pasted that into my camel route xml, the design looked like this:

       

      tryCatchCamelRoute.png

       

      But after I went back to the source view of the route it turned (broke?) into this:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
             http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
             http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
      
       <bean id="numericTransformation" class="com.test.javatransformator.NumericTransformation" />
      
       <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
          <from uri="direct:start"/>
          <doTry>
            <process ref="processorFail"/>
            <to uri="mock:result"/>
            <doFinally>
              <to uri="mock:finally"/>
            </doFinally>
          </doTry>
        </route>
      </camelContext>
      
      </blueprint>
      
      
      And when I went back to the Design view it looked like this:
      tryCatchCamelRoute2.png
      And as you can see the catch is nowhere to be found and my route went kaput.
      What I'm doing wrong?
      PS: I'm using this version of Jboss Studio Version: 8.1.0.GA
      Build id: GA-v20150327-1349-B467
      Build date: 20150327-1349
      Any help would be very much appreciated!
        • 1. Re: Try Catch blocks get disrupted
          lhein

          Hello Raul,

           

          thank you for reporting this issue. What you hit here is a known issue which will be fixed with the next major release of the Fuse Tooling which will be part of JBDSIS 9.

           

          See below screenshots which I took using your route.

           

          Bildschirmfoto von »2016-01-07 09-03-00«.png

           

          Bildschirmfoto von »2016-01-07 09-02-21«.png

           

          A Beta1 version of the JBDSIS 9 will be cut around end of Jan so you can test it then.

           

          I hope this helps.

           

          Thanks

          Lars

          • 2. Re: Try Catch blocks get disrupted
            onimurasame

            Thank you Lars!

             

            I'm really looking forward to test that version!

             

            Regards,

            Raul.