From fe6e8c24719c7383a1be8c80f5be5d09f14ed42b Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Fri, 18 Mar 2022 10:58:34 +0700 Subject: [PATCH] add check consumer --- jetstream_pubsub.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetstream_pubsub.go b/jetstream_pubsub.go index c4c1aaa..2586eb8 100644 --- a/jetstream_pubsub.go +++ b/jetstream_pubsub.go @@ -53,7 +53,7 @@ func (js JetStream) PullSubscribe(stream, subject, durable, consumer string) (*n info, err := js.instance.AddConsumer(stream, &nats.ConsumerConfig{ Durable: durable, }) - if err != nil { + if err == nil { fmt.Println("CONSUMER INFO", info) } else { fmt.Println("ADD CONSUMER ERROR", err)