protected BridgeHandler bridge(String name, MessageChannel from, MessageChannel to, String bridgeName,
			final Collection<MimeType> acceptedMimeTypes, LocalBusPropertiesAccessor properties) {

		final boolean isInbound = bridgeName.startsWith("inbound.");

		BridgeHandler handler = new BridgeHandler() {

			@Override
			protected boolean shouldCopyRequestHeaders() {
				return false;
			}

			@Override
			protected Object handleRequestMessage(Message<?> requestMessage) {
				return requestMessage;
			}

		};

		handler.setBeanFactory(getBeanFactory());
		handler.setOutputChannel(to);
		handler.setBeanName(bridgeName);
		handler.afterPropertiesSet();

		// Usage of a CEFB allows to handle both Subscribable & Pollable channels the same way
		ConsumerEndpointFactoryBean cefb = new ConsumerEndpointFactoryBean();
		cefb.setBeanName(bridgeName);
		cefb.setInputChannel(from);
		cefb.setHandler(handler);
		cefb.setBeanFactory(getBeanFactory());
		if (from instanceof PollableChannel) {
			cefb.setPollerMetadata(poller);
		}
		try {
			cefb.afterPropertiesSet();
		}
		catch (Exception e) {
			throw new IllegalStateException(e);
		}

		try {
			cefb.getObject().setComponentName(handler.getComponentName());
			Binding binding = isInbound ? Binding.forConsumer(name, cefb.getObject(), to, properties)
					: Binding.forProducer(name, from, cefb.getObject(), properties);
			addBinding(binding);
			binding.start();
		}
		catch (Exception e) {
			throw new IllegalStateException(e);
		}
		return handler;
	}
Looks up or creates a DirectChannel with the given name and creates a bridge to that channel from the provided
channel instance.
spring-xd-messagebus-local/src/main/java/org/springframework/xd/dirt/integration/bus/local/LocalMessageBus.java