use of org.springframework.amqp.rabbit.connection.CachingConnectionFactory in project spring-boot by spring-projects.
the class RabbitAutoConfigurationTests method testConnectionFactoryDefaultVirtualHost.
@Test
public void testConnectionFactoryDefaultVirtualHost() {
load(TestConfiguration.class, "spring.rabbitmq.virtual_host:/");
CachingConnectionFactory connectionFactory = this.context.getBean(CachingConnectionFactory.class);
assertThat(connectionFactory.getVirtualHost()).isEqualTo("/");
}
use of org.springframework.amqp.rabbit.connection.CachingConnectionFactory in project spring-boot by spring-projects.
the class RabbitAutoConfigurationTests method testDefaultRabbitConfiguration.
@Test
public void testDefaultRabbitConfiguration() {
load(TestConfiguration.class);
RabbitTemplate rabbitTemplate = this.context.getBean(RabbitTemplate.class);
RabbitMessagingTemplate messagingTemplate = this.context.getBean(RabbitMessagingTemplate.class);
CachingConnectionFactory connectionFactory = this.context.getBean(CachingConnectionFactory.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(connectionFactory);
RabbitAdmin amqpAdmin = this.context.getBean(RabbitAdmin.class);
assertThat(rabbitTemplate.getConnectionFactory()).isEqualTo(connectionFactory);
assertThat(getMandatory(rabbitTemplate)).isFalse();
assertThat(messagingTemplate.getRabbitTemplate()).isEqualTo(rabbitTemplate);
assertThat(amqpAdmin).isNotNull();
assertThat(connectionFactory.getHost()).isEqualTo("localhost");
assertThat(dfa.getPropertyValue("publisherConfirms")).isEqualTo(false);
assertThat(dfa.getPropertyValue("publisherReturns")).isEqualTo(false);
assertThat(this.context.containsBean("rabbitListenerContainerFactory")).as("Listener container factory should be created by default").isTrue();
}
use of org.springframework.amqp.rabbit.connection.CachingConnectionFactory in project av-service by dvoraka.
the class AmqpReplicationClientConfig method connectionFactory.
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host);
connectionFactory.setUsername(userName);
connectionFactory.setPassword(userPassword);
connectionFactory.setVirtualHost(virtualHost);
return connectionFactory;
}
use of org.springframework.amqp.rabbit.connection.CachingConnectionFactory in project av-service by dvoraka.
the class EnvironmentConfiguratorConfig method connectionFactory.
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host);
connectionFactory.setUsername(userName);
connectionFactory.setPassword(userPassword);
connectionFactory.setVirtualHost(virtualHost);
return connectionFactory;
}
use of org.springframework.amqp.rabbit.connection.CachingConnectionFactory in project av-service by dvoraka.
the class AmqpBridgeOutputConfig method outConnectionFactory.
@Bean
public ConnectionFactory outConnectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host);
connectionFactory.setUsername(userName);
connectionFactory.setPassword(userPassword);
connectionFactory.setVirtualHost(virtualHost);
return connectionFactory;
}
Aggregations