Hi!
pause/stop/resume the flow
is equals to
stop/pause/resume a service activator
Any message flow starts from consumer(subscriber) on the channel.
So, you go right way: you should just stop your endpoint (PollingConsumer or EventDrivenConsumer) from it's SmartLifecycle abilities.
it will be enough to add an 'id' attribute for your <service-activator> and invoke it, e.g. from <control-bus>:
HTML Code:
<transformer input-channel="sendStopCommandChannel" output-channel="controlBusChannel"
expression="'@myServiceActivator.stop()'"/>
However be careful with that, you may end up with this one:
Code:
org.springframework.integration.MessageDeliveryException: Dispatcher has no subscribers for channel ...
when you unsubscribe from chennels who implement AbstractSubscribableChannel.
Hope that help
Take care,
Artem