@SpringBootApplication(exclude = {RabbitAutoConfiguration.class})
或者在yaml中配置
spring:
??autoconfigure:
????exclude: org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
spring:
??rabbitmq:
????addresses: localhost:5672
????username: guest
????password: guest
????virtual-host: /
????publisherConfirms: true # 回调ConfirmCallback实现类
????publisherReturns: true # 回调ReturnCallback实现类
????
template:
??enable:
????rabbitmq: false?# RabbitMQ开关
springcloud-template└──?template-framework?????└── autoconfigure??????????└── RabbitAutoConfiguration--?自定义RabbitMQ自动配置类