Skip to content

Commit

Permalink
specify loadbalance strategy on dubbo proxy (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark4z authored Feb 5, 2024
1 parent 87c6239 commit dd6630e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pixiu/pkg/client/dubbo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ type DubboProxyConfig struct {
AutoResolve bool `yaml:"auto_resolve" json:"auto_resolve,omitempty"`
// Protoset path to load protoset files
Protoset []string `yaml:"protoset" json:"protoset,omitempty"`
// Load
LoadBalance string `yaml:"load_balance" json:"load_balance,omitempty"`
}
6 changes: 6 additions & 0 deletions pixiu/pkg/client/dubbo/dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ import (

import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster/failover"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/consistenthashing"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/leastactive"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/p2c"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/random"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/ringhash"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/roundrobin"
"dubbo.apache.org/dubbo-go/v3/common/constant"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
dg "dubbo.apache.org/dubbo-go/v3/config"
Expand Down Expand Up @@ -313,6 +318,7 @@ func (dc *Client) create(key string, irequest fc.IntegrationRequest) *generic.Ge
Generic: "true",
Version: irequest.DubboBackendConfig.Version,
Group: irequest.Group,
Loadbalance: dc.dubboProxyConfig.LoadBalance,
}

if len(irequest.DubboBackendConfig.Retries) == 0 {
Expand Down

0 comments on commit dd6630e

Please sign in to comment.