Example usage for org.springframework.amqp.rabbit.connection RabbitConnectionFactoryBean setClientProperties

List of usage examples for org.springframework.amqp.rabbit.connection RabbitConnectionFactoryBean setClientProperties

Introduction

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

Prototype

public void setClientProperties(Map<String, Object> clientProperties) 

Source Link

Document

Add custom client properties.

Usage

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

@Test
@Ignore//from w w  w .j a v a2 s .  c o m
public void test() throws Exception {
    RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean();
    fb.setUseSSL(true);
    fb.setSslPropertiesLocation(new ClassPathResource("ssl.properties"));
    fb.setClientProperties(Collections.<String, Object>singletonMap("foo", "bar"));
    fb.afterPropertiesSet();
    ConnectionFactory cf = fb.getObject();
    assertEquals("bar", cf.getClientProperties().get("foo"));
    Connection conn = cf.newConnection();
    Channel chan = conn.createChannel();
    chan.close();
    conn.close();
}