mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-27 08:41:57 -06:00
Use all configured NATS addresses
This commit is contained in:
parent
c575f5501f
commit
0c88ac6158
|
@ -1,6 +1,7 @@
|
||||||
package kafka
|
package kafka
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
js "github.com/S7evinK/saramajetstream"
|
js "github.com/S7evinK/saramajetstream"
|
||||||
|
@ -66,7 +67,7 @@ func setupNaffka(cfg *config.Kafka) (sarama.Consumer, sarama.SyncProducer) {
|
||||||
|
|
||||||
func setupNATS(cfg *config.Kafka) (sarama.Consumer, sarama.SyncProducer) {
|
func setupNATS(cfg *config.Kafka) (sarama.Consumer, sarama.SyncProducer) {
|
||||||
logrus.WithField("servers", cfg.Addresses).Debug("connecting to nats")
|
logrus.WithField("servers", cfg.Addresses).Debug("connecting to nats")
|
||||||
nc, err := nats.Connect(cfg.Addresses[0])
|
nc, err := nats.Connect(strings.Join(cfg.Addresses, ","))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Panic("failed to connect to nats")
|
logrus.WithError(err).Panic("failed to connect to nats")
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|
Loading…
Reference in a new issue