Thought this could be a new thread. Is there any way in Spring Integration from which I could get the status (running/stopped) of any of my consumer ??
Thought this could be a new thread. Is there any way in Spring Integration from which I could get the status (running/stopped) of any of my consumer ??
Use a <gateway/> to send a message to the control bus...
Code:public interface ControlBus { boolean command(String command); } <int:gateway service-interface="foo.ControlBus" default-request-channel="controlBusChannel"/> ... @Autowired private ControlBus controlBus; ... if (controlBus.command("@rabbitAdapter.isRunning()")) { ... }
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
Thank you Gary. One very dumb question, are you declaring the controlBus variable and the "if" statement in the main here ?
In this case I @Autowired it (assumes the current class was a class declared in the Spring config).
If you are running from a main, and creating an application context, you can get a reference to it using
This assumes there is only one instance of ControlBus in the context (which there usually would be).Code:ControlBus controlBus = context.getBean(ControlBus.class)
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware