Add effective conditions for springcloud stream rocketmq adapter

pull/233/head
chen.ma 3 years ago
parent 8b32727010
commit 6df37af308

@ -18,6 +18,7 @@
package cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq; package cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq;
import cn.hippo4j.adapter.springcloud.stream.rocketmq.SpringCloudStreamRocketMQThreadPoolAdapter; import cn.hippo4j.adapter.springcloud.stream.rocketmq.SpringCloudStreamRocketMQThreadPoolAdapter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -28,6 +29,7 @@ import org.springframework.context.annotation.Configuration;
public class SpringCloudStreamRocketMQAutoConfiguration { public class SpringCloudStreamRocketMQAutoConfiguration {
@Bean @Bean
@ConditionalOnProperty(name = "spring.cloud.stream.rocketmq.binder.name-server")
public SpringCloudStreamRocketMQThreadPoolAdapter springCloudStreamRocketMQThreadPoolAdapter() { public SpringCloudStreamRocketMQThreadPoolAdapter springCloudStreamRocketMQThreadPoolAdapter() {
return new SpringCloudStreamRocketMQThreadPoolAdapter(); return new SpringCloudStreamRocketMQThreadPoolAdapter();
} }

Loading…
Cancel
Save