alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.38k stars 8.02k forks source link

sentinel dynamic push rules to nacos then nacos push the rules to springcloud gateway #1259

Closed 1522377063 closed 4 years ago

1522377063 commented 4 years ago

Issue Description

when i read this chapeter "Dynamic Rule Configuration" , I meet a problem: I install the nacos and sentinel dashboard in my centos7 system, I create a spring cloud gateway microservice named "nacos-gateway", so I create a file in nacos named "nacos-gateway-sentinel" the format is json and the content is [ { "resource": "nacos-provider_route", "limitApp": "default", "grade": 1, "count": 6, "strategy": 0, "controlBehavior": 0, "clusterMode": false } ] the "nacos-provider_route" is my gateway route resource name, is route to my provider microservice. Todo it , I do the follow things:

  1. I implements DynamicRuleProvider , DynamicRulePublisher and config nacos by NacosConfig java config class and as to be spring beans.

  2. I implements InitFunc and as to be spring beans.

  3. config my bootstrap.yml like this: **server: port: 80 spring: application: name: nacos-gateway cloud: nacos: discovery: server-addr: 192.168.253.150:8848 config: server-addr: 192.168.253.150:8848 file-extension: json

    sentinel dashboard

    sentinel: transport: dashboard: 192.168.253.150:8718

    sentinel datasource nacos

    datasource: ds: nacos: server-addr: 192.168.253.150:8848 dataId: ${spring.application.name}-sentinel groupId: DEFAULT_GROUP rule-type: flow* finally I run de springboot application find: My idea is not implement. Type: bug report or feature request*

Describe what happened (or what feature you want)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

sczyh30 commented 4 years ago

You may check logs in ~/logs/csp.