Uploaded image for project: 'Fuse Tooling'
  1. Fuse Tooling
  2. FUSETOOLS-2295

Support imports in Global Configuration Editor

    XMLWordPrintable

Details

    Description

      There are many examples where it is necessary to import bean configuration files or even other routes into a particular camel configuration. This ability would be handy to include.

      !-- import the routes from another XML file -->
      <import resource="myCoolRoutes.xml"/>
       
      <camelContext xmlns="http://camel.apache.org/schema/spring">
       
          <!-- refer to a given route to be used -->
          <routeContextRef ref="myCoolRoutes"/>
       
          <!-- we can of course still use routes inside camelContext -->
          <route id="inside">
              <from uri="direct:inside"/>
              <to uri="mock:inside"/>
          </route>
      </camelContext>
      

      or

       
      <beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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">
          <import resource="classpath:META-INF/beans.xml"/>
          <!-- START SNIPPET: e1 -->
          <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
              <route id="_route1">
                  <from id="_from1" uri="direct:cafe"/>
                  <split id="_split1">
                      <method bean="orderSplitter"/>
                      <to id="_to1" uri="direct:drink"/>
                  </split>
              </route>
              <route id="_route2">
                  <from id="_from2" uri="direct:drink"/>
                  <recipientList id="_recipientList1">
                      <method bean="drinkRouter"/>
                  </recipientList>
              </route>
              <route id="_route3">
                  <from id="_from3" uri="seda:coldDrinks?concurrentConsumers=2"/>
                  <to id="_to2" uri="bean:barista?method=prepareColdDrink"/>
                  <to id="_to3" uri="direct:deliveries"/>
              </route>
              <route id="_route4">
                  <from id="_from4" uri="seda:hotDrinks?concurrentConsumers=3"/>
                  <to id="_to4" uri="bean:barista?method=prepareHotDrink"/>
                  <to id="_to5" uri="direct:deliveries"/>
              </route>
              <route id="_route5">
                  <from id="_from5" uri="direct:deliveries"/>
                  <aggregate completionTimeout="5000" id="_aggregate1" strategyRef="aggregatorStrategy">
                      <correlationExpression>
                          <method bean="waiter" method="checkOrder"/>
                      </correlationExpression>
                      <to id="_to6" uri="bean:waiter?method=prepareDelivery"/>
                      <to id="_to7" uri="bean:waiter?method=deliverCafes"/>
                  </aggregate>
              </route>
          </camelContext>
          <!-- END SNIPPET: e1 -->
      </beans>
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bfitzpat_rh Brian Fitzpatrick (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: