Apache camel 以fire and forget方式调用Camel servlet或jetty端点

Apache camel 以fire and forget方式调用Camel servlet或jetty端点,apache-camel,Apache Camel,据我所知,Camel中的servlet和jetty端点都是一个请求-应答消息交换(InOut),需要out消息 因此,我假设当我向这些端点发送HTTP请求时,只有在路由的所有处理器都完成之后,才会发送回响应 是否有可能以一种先发后忘的方式调用这些端点,即只触发路由并立即返回响应,而不等待所有处理完成?当然,您只需要在路由中添加一些步骤(EIP或组件) 例如…此路由将所有请求发送到JMS队列(或seda等),该队列可以异步处理,并在消息进入队列后将ACK返回HTTP客户端 from("http:/

据我所知,Camel中的servlet和jetty端点都是一个请求-应答消息交换(InOut),需要out消息

因此,我假设当我向这些端点发送HTTP请求时,只有在路由的所有处理器都完成之后,才会发送回响应


是否有可能以一种先发后忘的方式调用这些端点,即只触发路由并立即返回响应,而不等待所有处理完成?

当然,您只需要在路由中添加一些步骤(EIP或组件)

例如…此路由将所有请求发送到JMS队列(或seda等),该队列可以异步处理,并在消息进入队列后将ACK返回HTTP客户端

from("http://localhost:9001/inbound")
    .to("activemq:inboundQ");

from("activemq:inboundQ")
    .to(...inbound processing...);

当然,您只需要在路由中放置一些步骤(EIP或组件)

例如…此路由将所有请求发送到JMS队列(或seda等),该队列可以异步处理,并在消息进入队列后将ACK返回HTTP客户端

from("http://localhost:9001/inbound")
    .to("activemq:inboundQ");

from("activemq:inboundQ")
    .to(...inbound processing...);
最后,我使用“seda”使其异步。请注意,这仅在我使用inOnly标记时异步运行:

<route autoStartup="true" id="x-service">
     <from uri="servlet:/xService"/>
     <inOnly uri="seda:x-service-execute-async" />
     <transform>
         <constant>OK</constant>
     </transform>
 </route>

 <route autoStartup="true" id="x-service-execute-async">
     <from uri="seda:x-service-execute-async"/>
     ...
 </route>

好啊
...
最后,我使用“seda”使其异步。请注意,这仅在我使用inOnly标记时异步运行:

<route autoStartup="true" id="x-service">
     <from uri="servlet:/xService"/>
     <inOnly uri="seda:x-service-execute-async" />
     <transform>
         <constant>OK</constant>
     </transform>
 </route>

 <route autoStartup="true" id="x-service-execute-async">
     <from uri="seda:x-service-execute-async"/>
     ...
 </route>

好啊
...

此问题与此问题基本相同