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 2021/07/09 04:18:19 UTC

[GitHub] [dubbo] AlbumenJ commented on issue #8221: dubbo consumer端对 方法自定义引入引发启动报错

AlbumenJ commented on issue #8221:
URL: https://github.com/apache/dubbo/issues/8221#issuecomment-876900688


   > > ```
   > > @DubboReference(timeout = 50000)
   > > private RoleAuthorizationService roleAuthorizationService;
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > 这种方式同一个api引用多了很容易出错,对开发来说很不友好
   > 
   > 确实,照这样说 Dubbo3 比 Dubbo2 对开发者更不友好了,失去了灵活性
   
   这里涉及到几个问题
   1. 如果开发者期望同一个引用对象在多个地方使用,同时又需要特殊配置参数,可以采用 Spring Bean 方式注入,在统一的地方生成 Dubbo 的 Reference
   2. 如果开发者期望多个地方使用的时候参数是不一样的,需要改变服务三元组(接口+版本+分组)信息,以此来唯一确定一个服务,对于框架来说一直以来的设计理念都是以三元组去做唯一定位的,为了规范使用在 Dubbo 3里面开启了强校验,同时依据最佳实践也不应该三元组一样的情况下改变参数去复用,这样很难去进行服务治理
   3. 如果开发这是希望运行时改变一些参数的,可以参考 RpcContext 动态传递参数


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