Pollable Consumer : Start Source if Lifecycle
When binding a `MessageSource`, start it if it implements `Lifecycle`. Resolves #1189
This commit is contained in:
committed by
Oleg Zhurakousky
parent
c1749ca866
commit
e040cf02b4
@@ -317,6 +317,9 @@ public abstract class AbstractMessageChannelBinder<C extends ConsumerProperties,
|
||||
getPolledConsumerRecoveryCallback(resources.getErrorInfrastructure(), properties));
|
||||
}
|
||||
postProcessPollableSource(bindingTarget);
|
||||
if (resources.getSource() instanceof Lifecycle) {
|
||||
((Lifecycle) resources.getSource()).start();
|
||||
}
|
||||
return new DefaultBinding<PollableSource<MessageHandler>>(name, group, inboundBindTarget,
|
||||
resources.getSource() instanceof Lifecycle ? (Lifecycle) resources.getSource() : null) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user