Java fire和忘记cxf web服务调用camel应用程序

时间:2014-06-27 13:20:17

标签: java web-services cxf apache-camel

我有一个java Web应用程序(引用引擎),它使用另一个Java Web应用程序(多播程序)调用Web服务,该应用程序利用Apache camel将消息多播到多个端点。

我们正在使用apache CXF webservice,它是在多播项目的camel上下文中定义的。目前报价引擎项目没有使用驼峰。

<cxf:cxfEndpoint id="caster"
        address="http://localhost:${multicaster.port}/caster"
        serviceClass="uk.co.glad.caster.core.casterWS"/>

有关其他信息,请参阅我的多线路路线

        <camel:route id="casterRoute">
            <camel:from ref="caster" />
            <camel:process ref="initProcessor" />
            <camel:multicast parallelProcessing="true" stopOnException="false" streaming="true">
                <camel:to uri="direct:WebService1"/>    
                <camel:to uri="direct:WebService2"/>
            </camel:multicast>
        </camel:route>

我需要对施法者cxf端点的调用才能解雇。我想向此服务发送消息并继续处理报价引擎项目而无需等待回复。

我的网络服务有一个无效的返回类型,因为我们甚至不需要回复。

我想我可以使用concurency api和未来的对象解决这个问题,但我想知道是否有更简洁的方法来做到这一点。也许使用camel配置,我已经阅读了“inonly”参数,但我看不出如何在配置中使用它。

感谢

汤姆

这是克劳斯在下面使用wireTap

提到的
        <cxf:cxfEndpoint id="caster"
             address="http://localhost:${multicaster.port}/caster"
             serviceClass="uk.co.glad.caster.core.casterWS"/>

        <camel:route id="tap">
            <camel:from ref="caster" />
            <camel:wireTap uri="direct:casterRoute" />
        </camel:route>

    <camel:route id="casterRoute">
        <camel:from uri="direct:casterRoute" />
        <camel:process ref="initProcessor" />
        <camel:multicast parallelProcessing="true" stopOnException="false" streaming="true">
            <camel:to uri="direct:WebService1"/>    
            <camel:to uri="direct:WebService2"/>
        </camel:multicast>
    </camel:route>

1 个答案:

答案 0 :(得分:1)

使用有线点击http://camel.apache.org/wire-tap,您可以单独处理点击的消息,您的CXF Web服务可以尽快终止。