You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "haiyang1985 (GitHub)" <gi...@apache.org> on 2019/01/28 07:15:23 UTC

[GitHub] [incubator-dubbo] haiyang1985 opened issue #3368: About route level weight

- [ ] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.0
* Operating System version: any
* Java version: 1.8

### Steps to reproduce this issue

Our company's registry is able to support request route (same as TagRouter), but we are able to combine one invoker to two different route rule. 
eg: 
TagRoute1: 
    -> Group1 (weight: 1)
        -> Invoker1
    -> Gropu2 (weight: 9)
        -> Invoker2
TagRoute2: 
    -> Group1 (weight: 5)
        -> Invoker1
    -> Gropu2 (weight: 5) 
        -> Invoker2

In the consumer side, the call to Invoker1 and Invoker2 will have 1:9 weight in TagRoute1. The 5:5 weight for them in TagRoute2. 
The issue is that the dubbo get weight from invoker url, not in route level. 

I have some ideas for that which one do you prefer? If solutions have been fixed, then i can send a PR to fix it.
1. Add setUrl method for Invoker, then we are able to set weight in invoker URL.
2. Extend the invoker with weight property, then we are able to set weight for each invoker in the Router level.
3. Extend the AbstractLoadBalance, we are able to extend the getWeight.


When 
1. xxx
2. xxx
3. xxx

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

What do you expected from the above steps?

### Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

```
Just put your stack trace here!
```


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3368 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] beiwei30 commented on issue #3368: Support route level weight in 2.7.0

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
feel free to submit pull request.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3368 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] haiyang1985 commented on issue #3368: Support route level weight in 2.7.0

Posted by "haiyang1985 (GitHub)" <gi...@apache.org>.
ok, this challenges me. Will do investigate and send PR later.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3368 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org