add check consumer

This commit is contained in:
Nam Huynh 2022-03-18 10:58:34 +07:00
parent 941e4c5ca3
commit fe6e8c2471
1 changed files with 1 additions and 1 deletions

View File

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