private void revertDirectBindingIfNecessary(Binding binding) {
		try {
			synchronized (this.bindings) { // Not necessary, called while synchronized, but just in case...
				Binding directBinding = null;
				Iterator<Binding> iterator = this.bindings.iterator();
				while (iterator.hasNext()) {
					Binding producer = iterator.next();
					if (Binding.DIRECT.equals(producer.getType()) && binding.getName().equals(producer.getName())) {
						this.revertingDirectBinding.set(Boolean.TRUE);
						bindProducer(producer.getName(), producer.getChannel(),
								producer.getPropertiesAccessor().getProperties());
						directBinding = producer;
						break;
					}
				}
				if (directBinding != null) {
					directBinding.stop();
					this.bindings.remove(directBinding);
					if (logger.isInfoEnabled()) {
						logger.info("direct binding reverted: " + directBinding);
					}
				}
			}
		}
		catch (Exception e) {
			logger.error("Could not revert direct binding: " + binding, e);
		}
	}
Attempt to bind a producer directly (avoiding the bus) if there is already a local producer. PubSub producers
cannot be bound directly. Create the direct binding, then unbind the existing bus producer.
@param name The name.
@param consumerChannel The channel to bind the producer to.
spring-xd-messagebus-spi/src/main/java/org/springframework/xd/dirt/integration/bus/MessageBusSupport.java