类 RabbitAutoConfiguration
- java.lang.Object
- org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
@Configuration @ConditionalOnClass({org.springframework.amqp.rabbit.core.RabbitTemplate.class,com.rabbitmq.client.Channel.class}) @EnableConfigurationProperties(RabbitProperties.class) @Import(org.springframework.boot.autoconfigure.amqp.RabbitAnnotationDrivenConfiguration.class) public class RabbitAutoConfiguration extends Object
Auto-configuration
forRabbitTemplate
.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:- spring.rabbitmq.port is used to specify the port to which the client should connect, and defaults to 5672.
- spring.rabbitmq.username is used to specify the (optional) username.
- spring.rabbitmq.password is used to specify the (optional) password.
- spring.rabbitmq.host is used to specify the host, and defaults to localhost.
- spring.rabbitmq.virtualHost is used to specify the (optional) virtual host to which the client should connect.
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
RabbitAutoConfiguration.MessagingTemplateConfiguration
protected static class
RabbitAutoConfiguration.RabbitConnectionFactoryCreator
protected static class
RabbitAutoConfiguration.RabbitTemplateConfiguration
构造器概要
构造器 构造器 说明 RabbitAutoConfiguration()
构造器详细资料
RabbitAutoConfiguration
public RabbitAutoConfiguration()