Example usage for org.springframework.amqp.rabbit.connection CachingConnectionFactory setBeanName

List of usage examples for org.springframework.amqp.rabbit.connection CachingConnectionFactory setBeanName

Introduction

In this page you can find the example usage for org.springframework.amqp.rabbit.connection CachingConnectionFactory setBeanName.

Prototype

@Override
    public void setBeanName(String name) 

Source Link

Usage

From source file:org.springframework.amqp.rabbit.connection.LocalizedQueueConnectionFactory.java

/**
 * Create a dedicated connection factory for the address.
 * @param address the address to which the factory should connect.
 * @param node  the node.//ww w .  j a  v  a 2s.  c  o m
 * @return the connection factory.
 * @throws Exception if errors occur during creation.
 */
protected ConnectionFactory createConnectionFactory(String address, String node) throws Exception {
    RabbitConnectionFactoryBean rcfb = new RabbitConnectionFactoryBean();
    rcfb.setUseSSL(this.useSSL);
    rcfb.setSslPropertiesLocation(this.sslPropertiesLocation);
    rcfb.setKeyStore(this.keyStore);
    rcfb.setTrustStore(this.trustStore);
    rcfb.setKeyStorePassphrase(this.keyStorePassPhrase);
    rcfb.setTrustStorePassphrase(this.trustStorePassPhrase);
    rcfb.afterPropertiesSet();
    CachingConnectionFactory ccf = new CachingConnectionFactory(rcfb.getObject());
    ccf.setAddresses(address);
    ccf.setUsername(this.username);
    ccf.setPassword(this.password);
    ccf.setVirtualHost(this.vhost);
    ccf.setBeanName("node:" + node);
    return ccf;
}