@Bean
	// TODO: Move to spring boot
	public ConnectionFactory rabbitConnectionFactory(RabbitProperties config,
			com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory) throws Exception {
		CachingConnectionFactory factory = new CachingConnectionFactory(rabbitConnectionFactory);
		factory.setAddresses(config.getAddresses());
		if (config.getHost() != null) {
			factory.setHost(config.getHost());
			factory.setPort(config.getPort());
		}
		if (config.getUsername() != null) {
			factory.setUsername(config.getUsername());
		}
		if (config.getPassword() != null) {
			factory.setPassword(config.getPassword());
		}
		if (config.getVirtualHost() != null) {
			factory.setVirtualHost(config.getVirtualHost());
		}
		if (this.channelCacheSize != null) {
			factory.setChannelCacheSize(this.channelCacheSize);
		}
		return factory;
	}
Configures the connection factory used by the rabbit message bus.

@author Eric Bottard
@author Gary Russell
@author David Turanski
spring-xd-messagebus-rabbit/src/main/java/org/springframework/xd/dirt/integration/rabbit/ConnectionFactorySettings.java