From 11bc0b9552e4b0fd19f72284c7ed01c5ff3ef590 Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Fri, 18 Mar 2022 11:00:26 +0700 Subject: [PATCH] add check consumer --- jetstream_pubsub.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetstream_pubsub.go b/jetstream_pubsub.go index 2586eb8..28bc81f 100644 --- a/jetstream_pubsub.go +++ b/jetstream_pubsub.go @@ -51,7 +51,8 @@ func (js JetStream) PullSubscribe(stream, subject, durable, consumer string) (*n fmt.Println("err", err) if con == nil { info, err := js.instance.AddConsumer(stream, &nats.ConsumerConfig{ - Durable: durable, + Durable: durable, + AckPolicy: nats.AckExplicitPolicy, }) if err == nil { fmt.Println("CONSUMER INFO", info)