You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/04/05 09:52:59 UTC

[GitHub] zonghaishang commented on issue #1552: How can I add a custom param(SPI) when zookeeperRegistry register url on zk

zonghaishang commented on issue #1552: How can I add a custom param(SPI) when zookeeperRegistry register url on zk
URL: https://github.com/apache/incubator-dubbo/issues/1552#issuecomment-378882053
 
 
   
   you can see  https://github.com/apache/incubator-dubbo/pull/1438 for more details.
   
   yiji
   
   
   在 2018年4月4日,13:02,周晨敏 <no...@github.com>> 写道:
   
   
   the similar issue is #1367<https://github.com/apache/incubator-dubbo/issues/1367> but I didn't get solution from it.
   I need to write a custom router for dubbo AB test( not the group lable in xml )
   I notice that AbstractDirectory.java<https://github.com/apache/incubator-dubbo/blob/master/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/directory/AbstractDirectory.java>
   In the method
   
   
   1. protected void setRouters(List<Router> routers) {
   2.         // copy list
   3.         routers = routers == null ? new ArrayList<Router>() : new ArrayList<Router>(routers);
   4.         // append url router
   5.         String routerkey = url.getParameter(Constants.ROUTER_KEY);
   6.         if (routerkey != null && routerkey.length() > 0) {
   7.             RouterFactory routerFactory = ExtensionLoader.getExtensionLoader(RouterFactory.class).getExtension(routerkey);
   8.             routers.add(routerFactory.getRouter(url));
   9.         }
   10.         // append mock invoker selector
   11.         routers.add(new MockInvokersSelector());
   12.         Collections.sort(routers);
   13.         this.routers = routers;
   14.     }
   
   
   
   It will add some additional router ( I mean not from category routers but from from registry url) 。I don't want add a router in dubbo-admin-web for every Interface, I want a global setting
   like filter or balance lable such as <dubbo:consumer filter="traceFilter" loadbalance=" ***** "></dubbo:consumer> OR I has some ways to add a param &router=myRouter& in registry url 。
   
   can anyone help me , thx。
   
   —
   You are receiving this because you are subscribed to this thread.
   Reply to this email directly, view it on GitHub<https://github.com/apache/incubator-dubbo/issues/1552>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AO1FUTfWNJnpTrHSrwVExa1zc39cxd_Kks5tlFPHgaJpZM4TGLDe>.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services