Example usage for com.rabbitmq.client ConnectionFactory getHost

List of usage examples for com.rabbitmq.client ConnectionFactory getHost

Introduction

In this page you can find the example usage for com.rabbitmq.client ConnectionFactory getHost.

Prototype

public String getHost() 

Source Link

Usage

From source file:org.teksme.server.common.messaging.AMQPBrokerManager.java

License:Apache License

private void toString(ConnectionFactory connFactory) {
    logger.info("[ Username: " + connFactory.getUsername() + " | Password: ****** | Virtual Host: "
            + connFactory.getVirtualHost() + " | Host: " + connFactory.getHost() + " | Port: "
            + connFactory.getPort() + " ]");
}

From source file:zipkin2.autoconfigure.collector.rabbitmq.ZipkinRabbitMQCollectorPropertiesTest.java

License:Apache License

@Test
public void uriProperlyParsedAndIgnoresOtherProperties_whenUriSet() throws Exception {
    properties.setUri(URI.create("amqp://admin:admin@localhost:5678/myv"));
    properties.setAddresses(Collections.singletonList("will_not^work!"));
    properties.setUsername("bob");
    properties.setPassword("letmein");
    properties.setVirtualHost("drwho");

    assertThat(properties.toBuilder()).extracting("connectionFactory").allSatisfy(object -> {
        ConnectionFactory connFactory = (ConnectionFactory) object;
        assertThat(connFactory.getHost()).isEqualTo("localhost");
        assertThat(connFactory.getPort()).isEqualTo(5678);
        assertThat(connFactory.getUsername()).isEqualTo("admin");
        assertThat(connFactory.getPassword()).isEqualTo("admin");
        assertThat(connFactory.getVirtualHost()).isEqualTo("myv");
    });// w  w w  . ja  v  a  2 s . c o  m
}