开发者社区 > 云原生 > 正文

将Zuul与Spring Cloud Alibaba Sentinel和Apollo数据源一起使用时

版本号:sentinel-zuul-adapter 1.6.3 spring-cloud-alibaba-sentinel-gateway 2.1.0.RELEASE spring-cloud-starter-alibaba-sentinel 0.2.2.RELEASE jdk 1.8.0_231

zuul网关拉取Apollo配置规则时报错: Failed to bind properties under 'spring.cloud.sentinel.datasource.ds6.apollo.rule-type' to org.springframework.cloud.alibaba.sentinel.datasource.RuleType:

Property: spring.cloud.sentinel.datasource.ds6.apollo.rule-type Value: gw-flow Origin: "spring.cloud.sentinel.datasource.ds6.apollo.rule-type" from property source "ApolloBootstrapPropertySources" Reason: failed to convert java.lang.String to @javax.validation.constraints.NotNull org.springframework.cloud.alibaba.sentinel.datasource.RuleType

Update your application's configuration. The following values are valid:

AUTHORITY DEGRADE FLOW PARAM_FLOW SYSTEM

Apollo配置参数: spring.cloud.sentinel.datasource.ds6.apollo.namespace-name = DepartmentName.sentinel spring.cloud.sentinel.datasource.ds6.apollo.rule-type = gw-flow spring.cloud.sentinel.datasource.ds6.apollo.flow-rules-key = ${spring.application.name}-${spring.cloud.sentinel.datasource.ds6.apollo.rule-type}

另外sentinel-dashboard里面识别不出应用为网关,在idea里面直接加了启动参数-Dcsp.sentinel.app.type=1 配置项也加了:csp.sentinel.app.type=1

原提问者GitHub用户kingskylar

展开
收起
码字王 2023-05-19 16:58:09 154 0
1 条回答
写回答
取消 提交回答
  • 确认下spring-cloud-starter-alibaba-sentinel是否是最新版本。

    原回答者GitHub用户

    2023-05-19 22:44:15
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
阿里云容器 AHAS Sentinel 网关流控揭秘 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Sentinel进行微服务流量控制 立即下载
Sentinel分布式系统下的流量防卫兵 立即下载