搭建文档参考
api功能测试
第 3.2.1 节 获取App的环境,集群信息
下载 sentinel 1.6 源码,拷贝test 目录下的 apollo到工程的rule目录下
解决 user(dataChangeLastModifiedBy) not exists 报错问题需要 设置 FlowRuleApolloPublisher
openItemDTO.setDataChangeCreatedBy("apollo");
Caused by: com.ctrip.framework.apollo.openapi.client.exception.ApolloOpenApiException: Request to apollo open api failed, status code: 400, reason: , message: {"exception":"com.ctrip.framework.apollo.common.exception.BadRequestException","message":"user(dataChangeLastModifiedBy) not exists","status":400,"timestamp":"2019-05-26T23:03:31.2"}
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.checkHttpResponseStatus(AbstractOpenApiService.java:99) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:80) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:74) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.put(AbstractOpenApiService.java:54) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.ItemOpenApiService.createOrUpdateItem(ItemOpenApiService.java:120) ~[apollo-openapi-1.2.0.jar:1.2.0]
... 65 common frames omitted
解决 user(releaseBy) not exists 报错问题需要 设置 FlowRuleApolloPublisher
namespaceReleaseDTO.setReleasedBy("apollo");
Caused by: com.ctrip.framework.apollo.openapi.client.exception.ApolloOpenApiException: Request to apollo open api failed, status code: 400, reason: , message: {"exception":"com.ctrip.framework.apollo.common.exception.BadRequestException","message":"user(releaseBy) not exists","status":400,"timestamp":"2019-05-26T23:17:51.724"}
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.checkHttpResponseStatus(AbstractOpenApiService.java:99) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:80) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.execute(AbstractOpenApiService.java:74) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.AbstractOpenApiService.post(AbstractOpenApiService.java:48) ~[apollo-openapi-1.2.0.jar:1.2.0]
at com.ctrip.framework.apollo.openapi.client.service.ReleaseOpenApiService.publishNamespace(ReleaseOpenApiService.java:35) ~[apollo-openapi-1.2.0.jar:1.2.0]
... 65 common frames omitted
[root@hadoop daxing]# /home/daxing/apollo-configservice-1.3.0-github/scripts/startup.sh
[root@hadoop daxing]# /home/daxing/apollo-adminservice-1.3.0-github/scripts/startup.sh
[root@hadoop daxing]# /home/daxing/apollo-portal-1.3.0-github/scripts/startup.sh
附整合好的代码
对接 apollo v1.3.0 测试成功
参考:
动态规则扩展
apollo 数据源样例
控制台接入