【发布时间】:2015-05-12 13:07:03
【问题描述】:
我们有一个要求,外部客户端正在调用我们的 Spring 集成入站 Web 服务网关之一,我们需要立即以一般的 OK 状态确认它们。同时,payload会被提交到一个channel进行异步处理,我们不需要response(根据一些业务验证发送email)。
我们尝试使用异步网关和执行器通道(带有任务执行器),但无法弄清楚如何使网关立即响应。在这两种情况下,它都作为单向 Web 服务运行,没有响应。
配置:
<context:component-scan base-package="com.myapp.springintegration" />
<channel id="helloWorldRequestChannel">
<dispatcher task-executor="taskExecutor"/>
</channel>
<channel id="helloWorldReplyChannel"/>
<task:executor id="taskExecutor" pool-size="2"/>
<gateway id="helloServiceGateway"
service-interface="com.myapp.springintegration.HelloService"
default-request-channel="helloWorldRequestChannel" default-reply-channel="helloWorldReplyChannel"/>
<service-activator input-channel="helloWorldRequestChannel" ref="helloServiceImpl" method="hello" />
【问题讨论】:
标签: java web-services asynchronous spring-integration