You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "dhyly (via GitHub)" <gi...@apache.org> on 2023/05/25 08:43:30 UTC

[GitHub] [dubbo] dhyly opened a new issue, #12402: 扩展依赖注入器(ExtensionInjector)集合无法自定义排序规则

dhyly opened a new issue, #12402:
URL: https://github.com/apache/dubbo/issues/12402

   ### Environment
   
   * Dubbo version: 3.0.7
   * Operating System version: win 10
   * Java version: 1.8
   
   ### Issue
   
   默认的自适应扩展点AdaptiveExtensionInjector,其初始化方法initialize中获取到ExtensionInjector所有扩展实现,但是默认通过TreeSet进行排序,即按照SPI文件中指定的扩展别名进行的排序:
   
   **initialize方法:**
   
   ![image](https://github.com/apache/dubbo/assets/86190302/b34eeee4-5064-4e27-83ef-a328e4118ba9)
   
   **getSupportedExtensions方法:**
   
   ![image](https://github.com/apache/dubbo/assets/86190302/92aa26ca-58fa-4a8e-a13e-ce49abdc70e6)
   
   如果我自定义一个CustomSpiExtensionInjector,我无法像Spring中继承Order接口一样,实现对自定义的扩展依赖注入器执行顺序的控制,为了防止自定义的扩展依赖注入器影响到dubbo内部的依赖注入逻辑,需要借助与自定义注解限制其处理范围:
   
   ![image](https://github.com/apache/dubbo/assets/86190302/a1ee05d7-023a-4037-a12a-2c2eb22a1494)
   
   ### thinking
   
   能否提供对扩展依赖注入器(ExtensionInjector)的排序支持
   
   


-- 
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] AYue-94 commented on issue #12402: 扩展依赖注入器(ExtensionInjector)集合无法自定义排序规则

Posted by "AYue-94 (via GitHub)" <gi...@apache.org>.
AYue-94 commented on issue #12402:
URL: https://github.com/apache/dubbo/issues/12402#issuecomment-1563711592

   我的想法是。
   第一个问题,你可能可以尝试ExtensionPostProcessor这个扩展点在dubbo依赖注入前后自己判断。
   第二个问题,这个肯定是返回自适应扩展,这是dubbo框架从2.x开始的老逻辑,所有扩展点通过setter注入的地方都是自适应的。可能是为了让你遵循在运行时通过url来动态选择扩展点,而不是在一开始就决定注入一个死的扩展点。


-- 
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] dhyly commented on issue #12402: 扩展依赖注入器(ExtensionInjector)集合无法自定义排序规则

Posted by "dhyly (via GitHub)" <gi...@apache.org>.
dhyly commented on issue #12402:
URL: https://github.com/apache/dubbo/issues/12402#issuecomment-1563712989

   > 我的想法是。 第一个问题,你可能可以尝试ExtensionPostProcessor这个扩展点在dubbo依赖注入前后自己判断。 第二个问题,这个肯定是返回自适应扩展,这是dubbo框架从2.x开始的老逻辑,所有扩展点通过setter注入的地方都是自适应的。可能是为了让你遵循在运行时通过url来动态选择扩展点,而不是在一开始就决定注入一个死的扩展点。
   
   好的


-- 
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] dhyly closed issue #12402: 扩展依赖注入器(ExtensionInjector)集合无法自定义排序规则

Posted by "dhyly (via GitHub)" <gi...@apache.org>.
dhyly closed issue #12402: 扩展依赖注入器(ExtensionInjector)集合无法自定义排序规则
URL: https://github.com/apache/dubbo/issues/12402


-- 
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