Example usage for org.springframework.amqp.rabbit.connection SingleConnectionFactory setPort

List of usage examples for org.springframework.amqp.rabbit.connection SingleConnectionFactory setPort

Introduction

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

Prototype

public void setPort(int port) 

Source Link

Usage

From source file:com.apress.prospringintegration.messaging.rabbitmq.jms.adapter.RabbitmqConfiguration.java

@Bean
public SingleConnectionFactory connectionFactory() {
    SingleConnectionFactory connectionFactory = new SingleConnectionFactory("localhost");
    connectionFactory.setPort(5672);
    connectionFactory.setUsername("guest");
    connectionFactory.setPassword("guest");

    return connectionFactory;
}

From source file:org.springframework.amqp.rabbit.core.RabbitAdminTests.java

@Test
public void testNoFailOnStartupWithMissingBroker() throws Exception {
    SingleConnectionFactory connectionFactory = new SingleConnectionFactory("foo");
    connectionFactory.setPort(434343);
    GenericApplicationContext applicationContext = new GenericApplicationContext();
    applicationContext.getBeanFactory().registerSingleton("foo", new Queue("queue"));
    RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
    rabbitAdmin.setApplicationContext(applicationContext);
    rabbitAdmin.setAutoStartup(true);//from w  w w  .  j  a v  a  2s. c  o m
    rabbitAdmin.afterPropertiesSet();
    connectionFactory.destroy();
}

From source file:org.springframework.amqp.rabbit.core.RabbitAdminTests.java

@Test
public void testFailOnFirstUseWithMissingBroker() throws Exception {
    SingleConnectionFactory connectionFactory = new SingleConnectionFactory("localhost");
    connectionFactory.setPort(434343);
    GenericApplicationContext applicationContext = new GenericApplicationContext();
    applicationContext.getBeanFactory().registerSingleton("foo", new Queue("queue"));
    RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
    rabbitAdmin.setApplicationContext(applicationContext);
    rabbitAdmin.setAutoStartup(true);//from ww w.ja  va  2s.c o m
    rabbitAdmin.afterPropertiesSet();
    exception.expect(IllegalArgumentException.class);
    rabbitAdmin.declareQueue();
    connectionFactory.destroy();
}