【发布时间】:2016-12-27 08:22:25
【问题描述】:
我创建了一个控制通道和一个网关服务来向该通道发送控制消息。但是,在我调用应该返回布尔值的网关服务方法后,在消息提交后没有返回。
代码片段:
public interface SampleControlService {
boolean sendControl(String message);
}
....
@Autowired
private SampleControlService sampleControlService;
.....
boolean done = sampleControlService.sendControl("@testAdapter.stop()"); // message gets sent but it is not returning to caller
System.out.println("Done : " + done); // this line doesn't execute
// integration config
<int:channel id="controlChannel"/>
<int:gateway service-interface="com.test.service.SampleControlService" default-request-channel="controlChannel" />
<int:control-bus input-channel="controlChannel"/>
但是,如果我发送消息 @testAdapter.isRunning() 来检查状态,它会按预期返回。
【问题讨论】:
标签: java spring-integration gateway