You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/04/30 10:01:29 UTC
[GitHub] [dubbo] songxiaosheng opened a new issue, #9985: 过滤器中获取到的sidekey参数总是provider
songxiaosheng opened a new issue, #9985:
URL: https://github.com/apache/dubbo/issues/9985
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
### Environment
* Dubbo version: 3.0.7
* Operating System version: windows10+Linux
* Java version: 1.8
### Steps to reproduce this issue
1. 自定义过滤器从invoke对象中获取sidekey
2. 无论是消费者还是提供者获取到的sidekey都是provider
Pls. provide [GitHub address] to reproduce this issue.
### Expected Behavior
<!-- What do you expect from the above steps?-->
自定义过滤器中消费者从invoke中获取到的sidekey参数应该是consumer,这个在低版本时候是正常的
### Actual Behavior
<!-- What actually happens? -->
1. 自定义过滤器从invoke对象中获取sidekey
2. 无论是消费者还是提供者获取到的sidekey都是provider
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] chickenlj commented on issue #9985: 过滤器中获取到的sidekey参数总是provider
Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #9985:
URL: https://github.com/apache/dubbo/issues/9985#issuecomment-1119413010
你好,我这边没能复现此问题,请提供更多的问题及如何复现的细节。
`getParameter("side")` and `getSide()` 都没问题,你是用的 `getParameters()` 么?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] chickenlj commented on issue #9985: 过滤器中获取到的sidekey参数总是provider
Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #9985:
URL: https://github.com/apache/dubbo/issues/9985#issuecomment-1119415970
在 3.0 中 `getParameters()` 是完整的返回了 provider 侧的原始数据,因此 side=provider,这点在设计上是和 2.7 有明显差异的。
如是在 `getParameters` 上遇到的问题,建议调整为 `getSide()`,受限于 3.0 的设计理念,getParameters 的行为很难调整。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] songxiaosheng commented on issue #9985: 过滤器中获取到的sidekey参数总是provider
Posted by GitBox <gi...@apache.org>.
songxiaosheng commented on issue #9985:
URL: https://github.com/apache/dubbo/issues/9985#issuecomment-1119593445
我来贴一下我测试的代码: 如下代码是我做测试的过滤器不论消费者还是提供者拿到的都是provider
`package link.elastic.dubbo.spi;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;
@Activate(group = {CommonConstants.PROVIDER,CommonConstants.CONSUMER})
public class MyFilter implements Filter {
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
String sideKey = invoker.getUrl().getParameter("side");
return invoker.invoke(invocation);
}
}
`
再贴个图证明下我的Debug过程
![Uploading image.png…]()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] chickenlj commented on issue #9985: 过滤器中获取到的sidekey参数总是provider
Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #9985:
URL: https://github.com/apache/dubbo/issues/9985#issuecomment-1120119221
请注意忽略 Dubbo 内置的 “MetadataService”。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] chickenlj closed issue #9985: 过滤器中获取到的sidekey参数总是provider
Posted by GitBox <gi...@apache.org>.
chickenlj closed issue #9985: 过滤器中获取到的sidekey参数总是provider
URL: https://github.com/apache/dubbo/issues/9985
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org