Camel To Interceptor似乎不起作用

时间:2014-11-13 11:03:57

标签: apache-camel apache-servicemix

我在ServiceMix上部署了我的camel路由,并尝试使用camel interceptSendToEndpoint编写简单的拦截器PoC进行加密/解密;但这对我来说似乎不起作用!我在这里做错了吗?

<blueprint>       
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <routeBuilder ref="dynamicRouter" />
        <routeBuilder ref="inBundleRouter" />
        <routeBuilder ref="sqlRouter" />
        <routeBuilder ref="changeRouter" />
        <interceptSendToEndpoint uri="vm:changeRoute" inheritErrorHandler="true">
            <doTry>
            <to uri = "vm:outBundleRoute"/>
            <process ref = "printProcessor"/>  <!-- This would just print Exchange headers-->
            <doCatch>
                <exception>java.lang.Exception</exception>
                <log message="Message Failure" />
                <stop />
            </doCatch>
        </doTry>
        </interceptSendToEndpoint>
    </camelContext>
    <bean id="dynamicRouter" class="ex.route.DynamicRoute" />
    <bean id="inBundleRouter" class="ex.route.InBundleRoute" />
    <bean id="sqlRouter" class="ex.route.SQLRoute" />
    <bean id="changeRouter" class="ex.route.ChangeRoute" />
    <bean id="printProcessor" class="ex.processor.PrintProcessor" />
    <bean id="sqlProcessor" class="ex.processor.SQLProcessor" />
</blueprint>

这是我试图拦截的路线。

public class InBundleRoute extends RouteBuilder{
    @Override
    public void configure() throws Exception {
        from("vm:inBundleRoute")
        //.processRef("printProcessor")
        .log("In vm:inBundleRoute")
        .to ("vm:changeRoute");
    }
}

我希望这条路线不会被解雇。 但我看到这条路线正在运行

public class ChangeRoute extends RouteBuilder{
    @Override
    public void configure() throws Exception {
        from("vm:changeRoute")
        //.processRef("printProcessor")
        .log("In vm:changeRoute ")
        .to ("mock://acs");
    }
}

0 个答案:

没有答案