0
我創建了一個控制通道和一個網關服務來向該通道發送控制消息。但是,在我調用網關服務方法後,應該返回布爾值在消息提交後不返回。Spring集成網關服務方法在啓動/停止時不返回
代碼段:
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()來檢查狀態,它會返回預期。
謝謝,增加了新的方法。 – zdesam