Source:
public final Binding<MessageChannel> doBindConsumer(String name, String group, MessageChannel inputChannel, final C properties) throws BinderException { MessageProducer consumerEndpoint = null; try { ConsumerDestination destination = this.provisioningProvider.provisionConsumerDestination(name, group, properties); if (HeaderMode.embeddedHeaders.equals(properties.getHeaderMode())) { this.enhanceMessageChannel(inputChannel); } consumerEndpoint = createConsumerEndpoint(destination, group, properties); consumerEndpoint.setOutputChannel(inputChannel); if (consumerEndpoint instanceof InitializingBean) { ((InitializingBean) consumerEndpoint).afterPropertiesSet(); } if (consumerEndpoint instanceof Lifecycle) { ((Lifecycle) consumerEndpoint).start(); } return new DefaultBinding<MessageChannel>(name, group, inputChannel, consumerEndpoint instanceof Lifecycle ? (Lifecycle) consumerEndpoint : null) { @Override protected void afterUnbind() { try { if (this.getEndpoint() instanceof DisposableBean) { ((DisposableBean) this.getEndpoint()).destroy(); } } catch (Exception e) { AbstractMessageChannelBinder.this.logger .error("Exception thrown while unbinding " + this.toString(), e); } afterUnbindConsumer(destination, this.group, properties); destroyErrorInfrastructure(destination, group, properties); } }; } catch (Exception e) { if (consumerEndpoint instanceof Lifecycle) { ((Lifecycle) consumerEndpoint).stop(); } if (e instanceof BinderException) { throw (BinderException) e; } else if (e instanceof ProvisioningException) { throw (ProvisioningException) e; } else { throw new BinderException("Exception thrown while starting consumer: ", e); } } }

Target:
public final Binding<MessageChannel> doBindConsumer(String name, String group, MessageChannel inputChannel, final C properties) throws BinderException { MessageProducer consumerEndpoint = null; try { ConsumerDestination destination = this.provisioningProvider.provisionConsumerDestination(name, group, properties); if (HeaderMode.embeddedHeaders.equals(properties.getHeaderMode())) { enhanceMessageChannel(inputChannel); } consumerEndpoint = createConsumerEndpoint(destination, group, properties); consumerEndpoint.setOutputChannel(inputChannel); if (consumerEndpoint instanceof InitializingBean) { ((InitializingBean) consumerEndpoint).afterPropertiesSet(); } if (consumerEndpoint instanceof Lifecycle) { ((Lifecycle) consumerEndpoint).start(); } return new DefaultBinding<MessageChannel>(name, group, inputChannel, consumerEndpoint instanceof Lifecycle ? (Lifecycle) consumerEndpoint : null) { @Override protected void afterUnbind() { try { if (getEndpoint() instanceof DisposableBean) { ((DisposableBean) this.getEndpoint()).destroy(); } } catch (Exception e) { AbstractMessageChannelBinder.this.logger .error("Exception thrown while unbinding " + this.toString(), e); } afterUnbindConsumer(destination, this.group, properties); destroyErrorInfrastructure(destination, group, properties); } }; } catch (Exception e) { if (consumerEndpoint instanceof Lifecycle) { ((Lifecycle) consumerEndpoint).stop(); } if (e instanceof BinderException) { throw (BinderException) e; } else if (e instanceof ProvisioningException) { throw (ProvisioningException) e; } else { throw new BinderException("Exception thrown while starting consumer: ", e); } } }