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?

有帮助吗?

解决方案

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top