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

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

Introduction

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

Prototype

public void setPassword(String password) 

Source Link

Usage

From source file:org.springframework.cloud.stream.binder.rabbit.LocalizedQueueConnectionFactory.java

/**
 * Create a dedicated connection factory for the address.
 * @param address the address to which the factory should connect.
 * @return the connection factory./*from  ww w  .  ja v a  2s . co  m*/
 * @throws Exception if errors occur during creation.
 */
protected ConnectionFactory createConnectionFactory(String address) throws Exception {
    RabbitConnectionFactoryBean rcfb = new RabbitConnectionFactoryBean();
    rcfb.setUseSSL(this.useSSL);
    rcfb.setSslPropertiesLocation(this.sslPropertiesLocation);
    rcfb.afterPropertiesSet();
    CachingConnectionFactory ccf = new CachingConnectionFactory(rcfb.getObject());
    ccf.setAddresses(address);
    ccf.setUsername(this.username);
    ccf.setPassword(this.password);
    ccf.setVirtualHost(this.vhost);
    return ccf;
}