网关限流添加api分组后无法找到服务
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue Description
Type: *bug report*
### Describe what happened (or what feature you want)
当我没有在网关添加api分组的时候,一切正常,
当我在网关中添加了api分组,启动网关之后,控制台无法看到网关服务。
When I did not add an API group to the gateway, everything was normal,
When I add an api group to the gateway and start the gateway, the dashboard cannot see the gateway service.
这是我在GatewayConfig中添加的api分组
This is the api group I added in GatewayConfig
``` java
@PostConstruct
public void doInit() {
initCustomizedApis();
}
private void initCustomizedApis() {
Set definitions = new HashSet<>();
ApiDefinition api1 = new ApiDefinition("custom_system")
.setPredicateItems(new HashSet() {{
add(new ApiPathPredicateItem().setPattern("/system/sysUser/list"));
add(new ApiPathPredicateItem().setPattern("/system/sysOnline/**")
.setMatchStrategy(SentinelGatewayConstants.URL_MATCH_STRATEGY_PREFIX));
}});
definitions.add(api1);
GatewayApiDefinitionManager.loadApiDefinitions(definitions);
}
```
### Describe what you expected to happen
### How to reproduce it (as minimally and precisely as possible)
1. sentinel version 1.8.5
2. spring cloud alibaba version 2021.0.4.0
3. fastjson version 2.0.10
4. jdk version 1.8
5. 其他配置和文档一致(Other configurations are consistent with the documents)
### Tell us your environment
Windows11
### Anything else we need to know?
Contributor guide
Assessment
This issue has not been assessed yet.