4 Replies Latest reply on Jan 4, 2013 3:43 PM by Michael Huisking

    FuseESB 7.1 - ErrorHandler Properties Modified by Design Mode

    Michael Huisking Newbie

      Hi,

      I've been playing around with the new version of the IDE (nice) and am having a problem when I define a DeadLetterChannel error handler and attach it to the camel context and then switch to the graphical design view.

       

      For an example, I used the default camel-context.xml file that is generated by the Spring archetype, along with a simple little error handler def:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Configures the Camel Context-->
      
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:camel="http://camel.apache.org/schema/spring"
             xsi:schemaLocation="
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
             
        <camelContext errorHandlerRef="dlc" xmlns="http://camel.apache.org/schema/spring">
          <errorHandler id="dlc" type="DeadLetterChannel" deadLetterUri="log://deadLetterQueue">
              <redeliveryPolicy delayPattern="1:60000;2:300000;3:3600000;4:7200000;5:14400000;6:43200000" retryAttemptedLogLevel="ERROR" asyncDelayedRedelivery="true" maximumRedeliveries="6"></redeliveryPolicy>
          </errorHandler>
          <route>
              <description>here is a sample which processes the input files
               (leaving them in place - see the 'noop' flag)
               then performs content based routing on the message using XPath</description>
              <from uri="file:src/data?noop=true"></from>
              <choice>
                  <when>
                      <xpath>/person/city = 'London'</xpath>
                      <log message="UK message"></log>
                      <to uri="file:target/messages/uk"></to>
                  </when>
                  <otherwise>
                      <log message="Other message"></log>
                      <to uri="file:target/messages/others"></to>
                  </otherwise>
              </choice>
          </route>
      </camelContext>
      
      </beans>
      

       

      If I save it this way (without switching over to "Design" view) and run it everything works fine.  However, if I switch to Design view, my error handler becomes:

       

          <errorHandler rollbackLoggingLevel="WARN" level="ERROR" deadLetterUri="log://deadLetterQueue" type="DeadLetterChannel" id="dlc">
      

       

      Those added attributes of rollbackLoggingLevel and level are not valid for a DeadLetterChannel error handler (Error = "IllegalArgumentException: Attribute rollbackLoggingLevel can only be used if type is TransactionErrorHandler")

       

      Is there something about this particular route that's causing the designer to think this is a TransactionErrorHandler instead of a DeadLetterChannel type handler?

       

      This is for FuseIDE 7.1.0.fuse-047  32 bit Windows7

       

      Thanks in advance,

      Mick

       

      Edited by: mhuisking on Jan 4, 2013 1:10 AM

      Added IDE and OS versions.

        • 1. Re: FuseESB 7.1 - ErrorHandler Properties Modified by Design Mode
          Claus Ibsen Master

          Hi

           

          Thanks for reporting. I have logged a ticket

          http://fusesource.com/issues/browse/ECLIPSE-849

           

          You can define the error handler outside  style instead. Though its not using a nice namespace, and its more verbose. But then the switching to design editor should not cause a problem.

          • 3. Re: FuseESB 7.1 - ErrorHandler Properties Modified by Design Mode
            Michael Huisking Newbie

            Just for reference, the "bean" method would look like this:

             

            <?xml version="1.0" encoding="UTF-8"?>
            <!-- Configures the Camel Context-->
            
            <beans xmlns="http://www.springframework.org/schema/beans"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns:camel="http://camel.apache.org/schema/spring"
                   xsi:schemaLocation="
                   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                   http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
                   
              <bean id="dlc" class="org.apache.camel.builder.DeadLetterChannelBuilder">
                <property name="deadLetterUri" value="log://deadLetterQueue"></property>
                <property name="redeliveryPolicy" ref="dlcRedeliveryPolicy"></property>
              </bean>
             
               <bean id="dlcRedeliveryPolicy" class="org.apache.camel.processor.RedeliveryPolicy">
                <property name="delayPattern" value="1:60000;2:300000;3:3600000;4:7200000;5:14400000;6:43200000"></property>
                <property name="retryAttemptedLogLevel" value="ERROR"></property>
                <property name="asyncDelayedRedelivery" value="true"></property>
                <property name="maximumRedeliveries" value="6"></property>
              </bean>
                   
              <camelContext errorHandlerRef="dlc" xmlns="http://camel.apache.org/schema/spring">
                <route>
                    <description>here is a sample which processes the input files
                     (leaving them in place - see the 'noop' flag)
                     then performs content based routing on the message using XPath
                    </description>
                    <from uri="file:src/data?noop=true"></from>
                    <choice>
                        <when>
                            <xpath>/person/city = 'London'</xpath>
                            <log message="UK message"></log>
                            <to uri="file:target/messages/uk"></to>
                        </when>
                        <otherwise>
                            <log message="Other message"></log>
                            <to uri="file:target/messages/others"></to>
                        </otherwise>
                    </choice>
                </route>
            </camelContext>
            
            </beans>
            

             

            • 4. Re: FuseESB 7.1 - ErrorHandler Properties Modified by Design Mode
              Claus Ibsen Master

              I fixed this in Camel today. So any new release of Fuse IDE with updated Camel should have this fixed out of the box.