@Configuration @ConditionalOnClass(value={org.springframework.amqp.rabbit.core.RabbitTemplate.class,com.rabbitmq.client.Channel.class}) @EnableConfigurationProperties(value=RabbitProperties.class) @Import(value=org.springframework.boot.autoconfigure.amqp.RabbitAnnotationDrivenConfiguration.class) public class RabbitAutoConfiguration extends Object
Auto-configuration
for RabbitTemplate
.
This configuration class is active only when the RabbitMQ and Spring AMQP client libraries are on the classpath.
Registers the following beans:
RabbitTemplate
if there is
no other bean of the same type in the context.CachingConnectionFactory
instance if there is no other bean of the same type in the
context.AmqpAdmin
instance as long as
spring.rabbitmq.dynamic=true.
The CachingConnectionFactory
honors
the following properties:
Modifier and Type | Class and Description |
---|---|
protected static class |
RabbitAutoConfiguration.MessagingTemplateConfiguration |
protected static class |
RabbitAutoConfiguration.RabbitConnectionFactoryCreator |
Constructor and Description |
---|
RabbitAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
org.springframework.amqp.core.AmqpAdmin |
amqpAdmin(org.springframework.amqp.rabbit.connection.CachingConnectionFactory connectionFactory) |
org.springframework.amqp.rabbit.core.RabbitTemplate |
rabbitTemplate() |
@Bean @ConditionalOnMissingBean(value=org.springframework.amqp.core.AmqpAdmin.class) public org.springframework.amqp.core.AmqpAdmin amqpAdmin(org.springframework.amqp.rabbit.connection.CachingConnectionFactory connectionFactory)
@Bean @ConditionalOnMissingBean(value=org.springframework.amqp.rabbit.core.RabbitTemplate.class) public org.springframework.amqp.rabbit.core.RabbitTemplate rabbitTemplate()
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.