|
|
|
@ -128,12 +128,14 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
|
|
|
|
return &Balancer{
|
|
|
|
|
selectors: br.OutboundSelector,
|
|
|
|
|
strategy: &LeastPingStrategy{},
|
|
|
|
|
fallbackTag: br.FallbackTag,
|
|
|
|
|
ohm: ohm,
|
|
|
|
|
}, nil
|
|
|
|
|
case "roundrobin":
|
|
|
|
|
return &Balancer{
|
|
|
|
|
selectors: br.OutboundSelector,
|
|
|
|
|
strategy: &RoundRobinStrategy{},
|
|
|
|
|
fallbackTag: br.FallbackTag,
|
|
|
|
|
ohm: ohm,
|
|
|
|
|
}, nil
|
|
|
|
|
case "leastload":
|
|
|
|
@ -148,7 +150,8 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
|
|
|
|
leastLoadStrategy := NewLeastLoadStrategy(s)
|
|
|
|
|
return &Balancer{
|
|
|
|
|
selectors: br.OutboundSelector,
|
|
|
|
|
ohm: ohm, fallbackTag: br.FallbackTag,
|
|
|
|
|
ohm: ohm,
|
|
|
|
|
fallbackTag: br.FallbackTag,
|
|
|
|
|
strategy: leastLoadStrategy,
|
|
|
|
|
}, nil
|
|
|
|
|
case "random":
|
|
|
|
@ -156,7 +159,8 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
|
|
|
|
case "":
|
|
|
|
|
return &Balancer{
|
|
|
|
|
selectors: br.OutboundSelector,
|
|
|
|
|
ohm: ohm, fallbackTag: br.FallbackTag,
|
|
|
|
|
ohm: ohm,
|
|
|
|
|
fallbackTag: br.FallbackTag,
|
|
|
|
|
strategy: &RandomStrategy{},
|
|
|
|
|
}, nil
|
|
|
|
|
default:
|
|
|
|
|