You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "liunancun (via GitHub)" <gi...@apache.org> on 2023/02/24 06:04:36 UTC
[GitHub] [dubbo] liunancun opened a new issue, #11646: 有PenetrateAttachmentSelector的使用例子吗?
liunancun opened a new issue, #11646:
URL: https://github.com/apache/dubbo/issues/11646
https://cn.dubbo.apache.org/zh-cn/docs3-v2/java-sdk/advanced-features-and-usage/service/attachment
根据文档想通过PenetrateAttachmentSelector实现traceId参数传递,但没有看到有关于PenetrateAttachmentSelector的具体使用例子
--
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] liunancun commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "liunancun (via GitHub)" <gi...@apache.org>.
liunancun commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1445088820
@AlbumenJ 默认所有参数都透传的什么意思,我在第一个调用之前设置的参数,第一个调用之后参数就消失了,调用第二次的时候参数被清掉了,没办法设置一次参数,后面所有都可以用
--
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] AlbumenJ commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1445035125
目前 Dubbo 默认是使用的所有参数透传的模式。
关于例子 @aamingaa 可以帮忙补充下
--
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] liunancun closed issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "liunancun (via GitHub)" <gi...@apache.org>.
liunancun closed issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
URL: https://github.com/apache/dubbo/issues/11646
--
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] aamingaa commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "aamingaa (via GitHub)" <gi...@apache.org>.
aamingaa commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1445136639
> @aamingaa 原来我文件目录错了,要建META-INF/dubbo/internal/org.apache.dubbo.rpc.PenetrateAttachmentSelector层次的目录,我少建了internal目录,记得之前扩展Filter的时候不需要internal目录的,这个SPI扩展有什么区别吗?文档上没看到有关这部分的说明。
>
> @AlbumenJ 我想我可能理解错透传的意思了,我以为是A调B,然后A再调C的时候传递参数,我是想在一个地方设置Trace ID,然后在所有调用中都可以取到这个参数,实际上透传是A调用B,然后B再调用C的时候透传,如果A再调用其他参数就被清掉了
Dubbo SPI分为三类目录:
META-INF/services/ 目录:该目录下的 SPI 配置文件是为了用来兼容 Java SPI 。
META-INF/dubbo/ 目录:该目录存放用户自定义的 SPI 配置文件。
META-INF/dubbo/internal/ 目录:该目录存放 Dubbo 内部使用的 SPI 配置文件
Filter的拓展是放在dubbo目录下,例如org.apache.dubbo.rpc.filter.GenericFilter
--
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] liunancun commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "liunancun (via GitHub)" <gi...@apache.org>.
liunancun commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1445115310
@aamingaa 原来我文件目录错了,要建META-INF/dubbo/internal/org.apache.dubbo.rpc.PenetrateAttachmentSelector层次的目录,我少建了internal目录,记得之前扩展Filter的时候不需要internal目录的,这个SPI扩展有什么区别吗?文档上没看到有关这部分的说明。
@AlbumenJ 我想我可能理解错透传的意思了,我以为是A调B,然后A再调C的时候传递参数,我是想在一个地方设置Trace ID,然后在所有调用中都可以取到这个参数,实际上透传是A调用B,然后B再调用C的时候透传,如果A再调用其他参数就被清掉了
--
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] liunancun commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "liunancun (via GitHub)" <gi...@apache.org>.
liunancun commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1447509274
@AlbumenJ OK
--
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] aamingaa commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "aamingaa (via GitHub)" <gi...@apache.org>.
aamingaa commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1445041184
https://github.com/apache/dubbo-samples/blob/master/2-advanced/dubbo-samples-rpccontext/src/main/java/org/apache/dubbo/samples/rpccontext/impl/PenetrateAttachmentSelectorImpl1.java
--
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] liunancun commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "liunancun (via GitHub)" <gi...@apache.org>.
liunancun commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1445097453
@aamingaa 实现PenetrateAttachmentSelector接口之后,怎么样注册才能生效
我新建了MyPenetrateAttachmentSelector类,实现了PenetrateAttachmentSelector接口,并且类上使用了@Activate注解
然后在META-INF/dubbo目录新建了org.apache.dubbo.rpc.PenetrateAttachmentSelector文件
内容是xxx=com.example.demo.MyPenetrateAttachmentSelector
做了这些之后,好像没有注册上这个SPI扩展,调用过程中没有进入我实现的select方法
--
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] AlbumenJ commented on issue #11646: 有PenetrateAttachmentSelector的使用例子吗?
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11646:
URL: https://github.com/apache/dubbo/issues/11646#issuecomment-1446131891
> @AlbumenJ 我想我可能理解错透传的意思了,我以为是A调B,然后A再调C的时候传递参数,我是想在一个地方设置Trace ID,然后在所有调用中都可以取到这个参数,实际上透传是A调用B,然后B再调用C的时候透传,如果A再调用其他参数就被清掉了
这个 Dubbo 侧时不能保留的,因为保留了以后 Dubbo 就没有机会清理了,这样会造成内存泄漏的。
如果是 Trace 的话可以借助外部的 Trace 工具,Dubbo 只负责向下游传递,不负责进程内传递
--
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