第三步:在Spring Cloud应用中添加配置信息:
spring.application.name=sentinel-datasource-apollo
server.port=8002
apollo config
app.id=${spring.application.name}
sentinel dashboard
spring.cloud.sentinel.transport.dashboard=localhost:8080
sentinel datasource apollo
spring.cloud.sentinel.datasource.ds.apollo.namespaceName=application
spring.cloud.sentinel.datasource.ds.apollo.flowRulesKey=sentinel.flowRules
-
app.id
:Apollo中的创建的项目名称,这里采用spring.application.name
参数的引用,从而达到服务名与配置项目名一致的效果 -
spring.cloud.sentinel.transport.dashboard
:sentinel dashboard的访问地址,根据上面准备工作中启动的实例配置 -
spring.cloud.sentinel.datasource.ds.apollo.namespaceName
:Apollo的空