Skip to content

Commit 514fe74

Browse files
committed
Allow same external server mapping
1 parent 4d61449 commit 514fe74

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

proxy/proxy.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ func NewListeners(cfg *config.Config) (*Listeners, error) {
5757

5858
// add mapping without starting local listeners
5959
for _, v := range cfg.Proxy.ExternalServers {
60-
if _, ok := brokerToListenerAddresses[v.BrokerAddress]; ok {
61-
return nil, fmt.Errorf("broker to listener address mapping %s configured twice", v.BrokerAddress)
60+
if la, ok := brokerToListenerAddresses[v.BrokerAddress]; ok {
61+
if la != v.ListenerAddress {
62+
return nil, fmt.Errorf("broker to listener address mapping %s configured twice: %s and %s", v.BrokerAddress, v.ListenerAddress, la)
63+
}
64+
continue
6265
}
6366
brokerToListenerAddresses[v.BrokerAddress] = v.ListenerAddress
6467
}

0 commit comments

Comments
 (0)