From 0c88ac6158d3c96995292f1e61407a3bbc8ad469 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Sun, 4 Jul 2021 22:11:00 +0200 Subject: [PATCH] Use all configured NATS addresses --- setup/kafka/kafka.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/kafka/kafka.go b/setup/kafka/kafka.go index c8882e8bf..eafdbc0fc 100644 --- a/setup/kafka/kafka.go +++ b/setup/kafka/kafka.go @@ -1,6 +1,7 @@ package kafka import ( + "strings" "time" 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) { 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 { logrus.WithError(err).Panic("failed to connect to nats") return nil, nil