use of org.springframework.amqp.rabbit.connection.CachingConnectionFactory in project spring-boot by spring-projects.
the class RabbitAutoConfigurationTests method testConnectionFactoryEmptyVirtualHost.
@Test
public void testConnectionFactoryEmptyVirtualHost() {
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 av-service by dvoraka.
the class AmqpCommonServerConfig method serverConnectionFactory.
@Bean
public ConnectionFactory serverConnectionFactory() {
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 AmqpTestReplicationClientConfig 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 AmqpFileCommonConfig 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 spring-boot by spring-projects.
the class RabbitAutoConfigurationTests method testConnectionFactoryPublisherSettings.
@Test
public void testConnectionFactoryPublisherSettings() {
load(TestConfiguration.class, "spring.rabbitmq.publisher-confirms=true", "spring.rabbitmq.publisher-returns=true");
CachingConnectionFactory connectionFactory = this.context.getBean(CachingConnectionFactory.class);
RabbitTemplate rabbitTemplate = this.context.getBean(RabbitTemplate.class);
DirectFieldAccessor dfa = new DirectFieldAccessor(connectionFactory);
assertThat(dfa.getPropertyValue("publisherConfirms")).isEqualTo(true);
assertThat(dfa.getPropertyValue("publisherReturns")).isEqualTo(true);
assertThat(getMandatory(rabbitTemplate)).isTrue();
}
Aggregations