You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "eye-gu (via GitHub)" <gi...@apache.org> on 2024/12/06 08:53:06 UTC
[I] [Bug] Method level loadbalance cannot be modified on the consumer side [dubbo]
eye-gu opened a new issue, #14968:
URL: https://github.com/apache/dubbo/issues/14968
### Pre-check
- [X] I am sure that all the content I provide is in English.
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
dubbo: 3.2.14 jdk:17
### Steps to reproduce this issue
Using @Method annotation, config a mehtod loadbalance as roundrobin, but attempting to change it to random on the consumer side, did not take effect
provider:
```java
@DubboService(methods = {
@Method(name = "findList", loadbalance = "roundrobin")
})
```
consumer:
```
RpcContext.getClientAttachment().setAttachment(CommonConstants.LOADBALANCE_KEY, "random");
```
### What you expected to happen
Can dynamically modify the loadbalance of the method on the consumer side. If there is a problem with my usage, please let me know the correct method. Thank you
### Anything else
_No response_
### Are you willing to submit a pull request to fix on your own?
- [ ] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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
Re: [I] [Bug] loadbalance cannot be modified on the consumer side [dubbo]
Posted by "laywin (via GitHub)" <gi...@apache.org>.
laywin commented on issue #14968:
URL: https://github.com/apache/dubbo/issues/14968#issuecomment-2522638918
```java
protected LoadBalance initLoadBalance(List<Invoker<T>> invokers, Invocation invocation) {
ApplicationModel applicationModel = ScopeModelUtil.getApplicationModel(invocation.getModuleModel());
if (CollectionUtils.isNotEmpty(invokers)) {
return applicationModel
.getExtensionLoader(LoadBalance.class)
.getExtension(invokers.get(0)
.getUrl()
.getMethodParameter(
RpcUtils.getMethodName(invocation), LOADBALANCE_KEY, DEFAULT_LOADBALANCE));
} else {
return applicationModel.getExtensionLoader(LoadBalance.class).getExtension(DEFAULT_LOADBALANCE);
}
}
```
you think you can override url by config on dubbo admin.
--
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
Re: [I] [Bug] loadbalance cannot be modified on the consumer side [dubbo]
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #14968:
URL: https://github.com/apache/dubbo/issues/14968#issuecomment-2534753017
`loadbalance` cannot be modified by invocation
--
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
Re: [I] [Bug] loadbalance cannot be modified on the consumer side [dubbo]
Posted by "eye-gu (via GitHub)" <gi...@apache.org>.
eye-gu closed issue #14968: [Bug] loadbalance cannot be modified on the consumer side
URL: https://github.com/apache/dubbo/issues/14968
--
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
Re: [I] [Bug] loadbalance cannot be modified on the consumer side [dubbo]
Posted by "eye-gu (via GitHub)" <gi...@apache.org>.
eye-gu closed issue #14968: [Bug] loadbalance cannot be modified on the consumer side
URL: https://github.com/apache/dubbo/issues/14968
--
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