add check consumer

This commit is contained in:
Nam Huynh 2022-03-18 11:00:26 +07:00
parent fe6e8c2471
commit 11bc0b9552
1 changed files with 2 additions and 1 deletions

View File

@ -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)