apache / apache/dubbo

Dubbo3.0.1无法通过URL获取CATEGORY参数的值

Open
#8,416 6 comments 0 reactions 1 assignee Claimed by @AlbumenJ View on GitHub
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.0.1
* Operating System version: Windwos 10
* Java version: java8

### Steps to reproduce this issue

1. 订阅 admin://192.168.56.1?category=providers,consumers&check=false&classifier=*&group=*&interface=*&version=*
subscribe the address admin://192.168.56.1?category=providers,consumers&check=false&classifier=*&group=*&interface=*&version=*
2. NotifyListener 接收到一个DubboServiceAddressURL 列表
NotifyListener rec a list DubboServiceAddressURL
3. 我收到URL为 dubbo://192.168.56.1/com.alen.dubbo.provider.comm.service.XX?application=dubbo-consumer&category=consumers&check=false&dubbo=2.0.2&group=g-1&interface=com.alen.dubbo.provider.comm.service.ISayService&metadata-type=remote&methods=say&path=com.alen.dubbo.provider.comm.service.ISayService&pid=3888&protocol=dubbo&release=3.0.1&side=consumer&sticky=false×tamp=1628075577836

i want get CATEGORY parameter

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

What do you expected from the above steps?
我想获取 到 CATEGORY 参数 的值 consumers
### Actual Result
实际获取到的值 为 providers
What actually happens?
```java
public String getParameter(String key) {
// call corresponding methods directly, then we can remove the following if branches.
if (GROUP_KEY.equals(key)) {
return getGroup();
} else if (VERSION_KEY.equals(key)) {
return getVersion();
} else if (APPLICATION_KEY.equals(key)) {
return getRemoteApplication();
} else if (SIDE_KEY.equals(key)) {
return getSide();
} else if (CATEGORY_KEY.equals(key)) {
return getCategory();
}
@Override
public String getCategory() {
return PROVIDERS_CATEGORY;
}```

If there is an exception, please attach the exception trace:

```
Just put your stack trace here!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.