3 Replies Latest reply on Jun 5, 2014 9:04 AM by Oliver Veits

    routeContext id removed by Fuse IDE

    Oliver Veits Newbie

      Hi community,

      Up to now I was working with Camel in java DSL. I wanted to give Fuse IDE graphical editor a try.

      I tried to use routeContext, so I can split up the routes into different files, so different developers can work on the same project more easily. However, if I try to save a route in the Fuse Editor, the routeContext id is removed. After that, the context cannot start anymore.

       

      In short, the line

      <routeContext id="routesInSeparateFile" xmlns="http://camel.apache.org/schema/spring">

      is replaced by

      <routeContext xmlns="http://camel.apache.org/schema/spring">

      in the separate file.


      I am using JBoss Fuse Camel Editor Feature within JBoss Developer Studio v7.1.1GA.


      Here this is the full content of the file, before I have opened it in the Fuse Camel Editor:

      ---


      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xmlns:tx="http://www.springframework.org/schema/tx"

             xmlns:context="http://www.springframework.org/schema/context"

             xmlns:aop="http://www.springframework.org/schema/aop"

             xmlns:util="http://www.springframework.org/schema/util"

             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

                                 http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd

                                 http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

       

        <routeContext id="routesInSeparateFile" xmlns="http://camel.apache.org/schema/spring">

          <route>

              <from uri="file:src/data/routesInSeparateFile2/inbox?noop=true"/>

              <to uri="file:src/data/routesInSeparateFile2/outbox?noop=true"/>

          </route>

          <route>

              <from uri="file:src/data/routesInSeparateFile/inbox?noop=true"/>

              <to uri="file:src/data/routesInSeparateFile/outbox?noop=true"/>

          </route>

          <route>

              <from uri="direct:test"/>

              <convertBodyTo type="java.lang.String"/>

          </route>

      </routeContext>

       

       

      </beans>

       

      After opening one of the two routes in the graphical editor and saving it, the content is replaced by:

      ---

      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xmlns:tx="http://www.springframework.org/schema/tx"

             xmlns:context="http://www.springframework.org/schema/context"

             xmlns:aop="http://www.springframework.org/schema/aop"

             xmlns:util="http://www.springframework.org/schema/util"

             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

                                 http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd

                                 http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

       

        <routeContext xmlns="http://camel.apache.org/schema/spring">

          <route>

              <from uri="file:src/data/routesInSeparateFile2/inbox?noop=true"/>

              <to uri="file:src/data/routesInSeparateFile2/outbox?noop=true"/>

          </route>

          <route>

              <from uri="file:src/data/routesInSeparateFile/inbox?noop=true"/>

              <to uri="file:src/data/routesInSeparateFile/outbox?noop=true"/>

          </route>

          <route>

              <from uri="direct:test"/>

              <convertBodyTo type="java.lang.String"/>

          </route>

      </routeContext>

       

       

      </beans>

       

      with the routeContext id missing.

       

      The context looks like follows:

      <import resource="routesInSeparateFile.xml"/>

      ...

      <camelContext xmlns="http://camel.apache.org/schema/spring">

          <routeContextRef ref="routesInSeparateFile"/>

      ... 

      </camelContext>

       

      Is there any way to split up the routes into different files, using the Fuse Camel Editor and not running into the problem that the routeContext ID is removed? Is there anybody, who has experience the same problem?

      Thanks,

      Oliver