Question

I'm thinking about migrating our project from spring dsl to java dsl but I wouldn't like to rewrite the whole config at once. How to use two configs(xml and java) together in camel? Is it reasonable to mix both approach at all?

Was it helpful?

Solution

It's totally reasonable. Reference your RouteBuilder that defines the Java DSL routes first, then any Spring routes like below.

<bean id="customerRoute" class="cc.notsoclever.examples.cxf.wsdlfirst.server.CustomerServiceRoutes">
</bean>

<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
    <routeBuilder ref="customerRoute"/>
    <route id="bar">
        <from uri="direct:bar"/>
        <to uri="mock:bar"/>
    </route>
</camel:camelContext>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top