Does MetadataService really need the external Activate filter chain? And there is no filter option to disable it.
- 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: the 3.0 branch of source code
* Operating System version: Mac M1
* Java version: 1.8
### Optional Solution
#### 1. It's just fine
Do nothing.
#### 2. Disable external `@Activate` filter for `org.apache.dubbo.metadata.MetadataService`
In the solution, we consider `MetadataService` as Internal serivcie, so we forbid user intercepting it.
We can archive it in `ProtocolFilterWrapper#export` and `ProtocolFilterWrapper#export` methods like `isRegistry` did.
```java
// => org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper
@Override
public Exporter export(Invoker invoker) throws RpcException {
if (UrlUtils.isRegistry(invoker.getUrl())) {
return protocol.export(invoker);
}
return protocol.export(builder.buildInvokerChain(invoker, SERVICE_FILTER_KEY, CommonConstants.PROVIDER));
}
@Override
public Invoker refer(Class type, URL url) throws RpcException {
if (UrlUtils.isRegistry(url)) {
return protocol.refer(type, url);
}
return builder.buildInvokerChain(protocol.refer(type, url), REFERENCE_FILTER_KEY, CommonConstants.CONSUMER);
}
```
#### 3. Add filter option for MetadataService as provider and consumer do.
If MetadataService really needs the external Activate filter chain, but I'm doubtful about it.
Contributor guide
Research direction
Start with org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper#export and #refer, then trace how MetadataService is handled and how UrlUtils.isRegistry bypasses the filter chain. Review the three proposed behaviors and the existing provider/consumer filter options. Done means the chosen behavior is implemented and MetadataService filtering is verified for both export and reference paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100