alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
28.02k stars 8.35k forks source link

Nacos dynamic data sources spring-cloud-starter-alibaba-sentinel bug #1642

Open huyunlonghu89 opened 4 years ago

huyunlonghu89 commented 4 years ago

Which Component spring-cloud-starter-alibaba-sentinel

Describe the bug Sentinel-dashboard persists nacos, which nacos as a data source, and Sentinel integrates with the Spring Cloud Gateway. SentinelAutoConfiguration class SentinelProperties properties without access to yml file configuration data sources, SentinelProperties class add @ Component annotation to solve the problem.

To Reproduce Steps to reproduce the behavior: Package depends on

com.alibaba.cloud spring-cloud-starter-alibaba-sentinel com.alibaba.cloud spring-cloud-alibaba-sentinel-gateway com.alibaba.csp sentinel-datasource-nacos

application.yml

spring: application: name: xxxx cloud: sentinel: datasource: ns: nacos: server-addr: xxx.xxx.xxx:80 data-id: wxxx-gateway-rules namespace: sentinel-dev group-id: SENTINEL_GROUP data-type: json rule-type: gw-flow Screenshots 1

2

Additional context MacOS 、Java8 、 Version spring-cloud-starter-alibaba-sentinel-2.2.1.RELEASE

yuhuangbin commented 4 years ago

Did you added this dependency?

<dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-sentinel-datasource</artifactId>
 </dependency>