如何检查Spring Integration中的邮件:inbound-channel-adapter是否正在运行?

时间:2012-12-12 16:39:00

标签: spring-integration

我正在使用控制总线来启动和停止邮件:Spring Integration中的入站通道适配器。 有没有办法检查频道状态?如果它正在运行?

非常感谢

1 个答案:

答案 0 :(得分:3)

使用消息传递网关向控制总线发送消息......

public interface Gateway {
    boolean controlBusBooleanMethod(String command);
}

...

<int:gateway service-interface="foo.Gateway" default-request-channel="toControlBus" />

...

@Autowired
Gateway gateway;

...

boolean isRunning = gateway.controlBusBooleanMethod("@adapter.isRunning()");

....

HTH