rocketmq-spring icon indicating copy to clipboard operation
rocketmq-spring copied to clipboard

Why is RocketMQAutoConfiguration @ConditionalOnProperty set to true

Open idealiezed opened this issue 4 years ago • 3 comments

RocketMQAutoConfiguration @ConditionalOnProperty(prefix = "rocketmq", value = {"name-server"}, matchIfMissing = true)

matchIfMissing的值为什么是true,true的话@ConditionalOnProperty似乎没有作用了。 能否改为false呢,因为有时本地是不能连MQ服务器的

idealiezed avatar Oct 14 '20 08:10 idealiezed

是否可以使用@EnableAufoConfiguration的execlude属性呢?

finnlee87 avatar Nov 13 '20 05:11 finnlee87

不行,因为我是本地环境不能连,其他环境连,EnableAufoConfiguration排除无法区分环境; 或者能否加个disabled配置呢,例如@ConditionalOnProperty(prefix = "rocketmq", value = “disabled”, matchIfMissing = true)

idealiezed avatar Nov 19 '20 07:11 idealiezed

spring boot支持在配置中通过spring.autoconfigure.exclude排除自动配置的类,但我不确定你的spring boot版本是否支持这个参数。

image

yanghao888 avatar Mar 18 '22 13:03 yanghao888