{"action":"created","issue":{"url":"https://api.github.com/repos/weibocom/motan/issues/600","repository_url":"https://api.github.com/repos/weibocom/motan","labels_url":"https://api.github.com/repos/weibocom/motan/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/weibocom/motan/issues/600/comments","events_url":"https://api.github.com/repos/weibocom/motan/issues/600/events","html_url":"https://github.com/weibocom/motan/issues/600","id":278416421,"number":600,"title":"自定义负载均衡一直不生效","user":{"login":"zfvipgit","id":16864657,"avatar_url":"https://avatars1.githubusercontent.com/u/16864657?v=4","gravatar_id":"","url":"https://api.github.com/users/zfvipgit","html_url":"https://github.com/zfvipgit","followers_url":"https://api.github.com/users/zfvipgit/followers","following_url":"https://api.github.com/users/zfvipgit/following{/other_user}","gists_url":"https://api.github.com/users/zfvipgit/gists{/gist_id}","starred_url":"https://api.github.com/users/zfvipgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfvipgit/subscriptions","organizations_url":"https://api.github.com/users/zfvipgit/orgs","repos_url":"https://api.github.com/users/zfvipgit/repos","events_url":"https://api.github.com/users/zfvipgit/events{/privacy}","received_events_url":"https://api.github.com/users/zfvipgit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-01T10:07:21Z","updated_at":"2017-12-01T10:45:03Z","closed_at":null,"author_association":"NONE","body":"\r\n/***************协议配置了需要使用的均衡策略activeWeightLcn******************/\r\n@Bean(name = \"motan\")\r\n    public ProtocolConfigBean protocolConfig() {\r\n        ProtocolConfigBean config = new ProtocolConfigBean();\r\n        config.setDefault(true);\r\n        config.setName(\"motan\");\r\n        config.setLoadbalance(\"activeWeightLcn\");\r\n        config.setMaxContentLength(5048576);\r\n        return config;\r\n    }\r\n/**********************************************************************************/\r\n\r\n\r\n\r\n\r\npackage com.codingapi.tx.motan.balance;\r\n\r\nimport com.weibo.api.motan.cluster.loadbalance.ActiveWeightLoadBalance;\r\nimport com.weibo.api.motan.common.MotanConstants;\r\nimport com.weibo.api.motan.core.extension.Activation;\r\nimport com.weibo.api.motan.core.extension.SpiMeta;\r\nimport com.weibo.api.motan.rpc.Referer;\r\nimport com.weibo.api.motan.rpc.Request;\r\n\r\n/**\r\n * <p>\"低并发优化\" 负载均衡代理</p>\r\n *\r\n * @author 张峰 zfvip_it@163.com\r\n * 2017/12/1 10:42\r\n */\r\n@SpiMeta(name = \"activeWeightLcn\")\r\n@Activation(key = {MotanConstants.NODE_TYPE_SERVICE, MotanConstants.NODE_TYPE_REFERER})\r\npublic class ActiveWeightLoadBalanceProxy extends ActiveWeightLoadBalance {\r\n\r\n    private LCNBalanceProxy lcnBalanceProxy = new LCNBalanceProxy();\r\n\r\n    @Override\r\n    protected Referer doSelect(Request request) {\r\n        return lcnBalanceProxy.proxy(super.doSelect(request));\r\n    }\r\n}\r\n"},"comment":{"url":"https://api.github.com/repos/weibocom/motan/issues/comments/348463140","html_url":"https://github.com/weibocom/motan/issues/600#issuecomment-348463140","issue_url":"https://api.github.com/repos/weibocom/motan/issues/600","id":348463140,"user":{"login":"rayzhang0603","id":2917437,"avatar_url":"https://avatars3.githubusercontent.com/u/2917437?v=4","gravatar_id":"","url":"https://api.github.com/users/rayzhang0603","html_url":"https://github.com/rayzhang0603","followers_url":"https://api.github.com/users/rayzhang0603/followers","following_url":"https://api.github.com/users/rayzhang0603/following{/other_user}","gists_url":"https://api.github.com/users/rayzhang0603/gists{/gist_id}","starred_url":"https://api.github.com/users/rayzhang0603/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayzhang0603/subscriptions","organizations_url":"https://api.github.com/users/rayzhang0603/orgs","repos_url":"https://api.github.com/users/rayzhang0603/repos","events_url":"https://api.github.com/users/rayzhang0603/events{/privacy}","received_events_url":"https://api.github.com/users/rayzhang0603/received_events","type":"User","site_admin":false},"created_at":"2017-12-01T10:45:03Z","updated_at":"2017-12-01T10:45:03Z","author_association":"COLLABORATOR","body":"有配置META-INF/services/下对应的扩展接口文件吗？\r\n在你自定义实现类的classpath下新建META-INF/services/com.weibo.api.motan.cluster.LoadBalance文件，把自定义的实现类全名写进去。可以参考motan-core包的对应文件"}}
{"actor":{"display_login":"rayzhang0603"}}