-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] How to get attachment data in the consumer ,attachment data set from provider cusome exception filter? #14416
Comments
Reference here: https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/service/attachment/ It's not a Bug, it's just a logic problem with the built-in Filter in the framework in the higher version of dubbo, you're using it the wrong way.Please reference herer https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/service/attachment/#%E5%8E%86%E5%8F%B2%E9%81%97%E7%95%99%E9%97%AE%E9%A2%98 |
Thanks for your reply! |
After consumer side filter DubboConsumerExceptionFilter#invoke method ,Still get no data!
|
It is not recommended to use obj as Attachment. For some protocols, only some basic types may be supported. |
Test on consumer filter set attachment data ,use |
another question,dubbo 3.0 how to define filter like this config : <dubbo:service filter="filter1,default,filter2,-token"/> |
Can you provide a working program? |
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
3.2.14
Steps to reproduce this issue
How to get attachment data in the consumer ,attachment data set from provider cusome exception filter ?
DubboProviderExceptionFilter:
RpcContextAttachment serverContext = RpcContext.getServerContext();
serverContext.setObjectAttachment(ATTA_NAME_EXCEPTION_CODE, br.getCode());
DubboConsumerExceptionFilter:
RpcContext.getServerContext().getObjectAttachments() ,RpcContext.getContext().getAttachments();
Neither method can be obtained
What you expected to happen
DubboProviderExceptionFilter set attachment data , DubboConsumerExceptionFilter get server attachment data ,used to customize exceptions extra data
Anything else
source code:
Are you willing to submit a pull request to fix on your own?
Code of Conduct
The text was updated successfully, but these errors were encountered: