nats-io/nack

Pull based consumer stuck with the first message

rytswd opened this issue · 0 comments

I followed the README steps, and got a bit stuck with the pull based consumer.

The below is what I got with the pull step (there is one additional message I tested with):

nats-box:~# nats pub orders.received "order 1"
22:38:30 Published 7 bytes to "orders.received"
nats-box:~# nats pub orders.received "order 2"
22:38:32 Published 7 bytes to "orders.received"
nats-box:~# nats pub orders.other "other order ABCDEF"
22:38:37 Published 18 bytes to "orders.other"
nats-box:~# nats consumer next mystream my-pull-consumer
--- subject: _INBOX.HCW9GpLC65HZhTydfegh0A

order 1

Acknowledged message
nats-box:~# nats consumer next mystream my-pull-consumer
--- subject: _INBOX.ciwMPLGB5fuE6PfyMTmaC0

order 1

Acknowledged message
nats-box:~# nats consumer next mystream my-pull-consumer
--- subject: _INBOX.pkfpec14mJGxXOn1jf4Bl7

order 1

Acknowledged message
nats-box:~# nats consumer next mystream my-pull-consumer
--- subject: _INBOX.6r2GUcY9rHARpBbcCPzN9h

order 1

Acknowledged message
nats-box:~# nats consumer next mystream my-pull-consumer
--- subject: _INBOX.pTHpbcMJV2qouexDevGrkA

order 1

Acknowledged message
nats-box:~# nats consumer next mystream my-pull-consumer
--- subject: _INBOX.JF2Rn72a8GRlxNMCTHHXBz

order 1

Acknowledged message

As you can see, I tried to get the next message with nats consumer next but it didn't get to the next message. It looks like the consumer next is not responding on the pull correctly?

nats-box:~# nats consumer info 
? Select a Stream mystream
? Select a Consumer my-pull-consumer
Information for Consumer mystream > my-pull-consumer

Configuration:

        Durable Name: my-pull-consumer
           Pull Mode: true
      Filter Subject: orders.received
         Deliver All: true
          Ack Policy: Explicit
            Ack Wait: 1ns
       Replay Policy: Instant
  Maximum Deliveries: 20

State:

  Last Delivered Message: Consumer sequence: 6 Stream sequence: 1
    Acknowledgment floor: Consumer sequence: 0 Stream sequence: 0
        Pending Messages: 1
    Redelivered Messages: 1

(Btw, I have seen this in the past, but the Consumer sequence being greater than the Stream sequence was rather surprising to me. I thought the Consumer sequence would stay as 1.)


Just for a reference, the push based consumer works as expected:

nats-box:~# nats sub my-push-consumer.orders
22:50:01 Subscribing on my-push-consumer.orders
22:50:01 [#1] Received on "my-push-consumer.orders"
order 1

22:50:01 [#2] Received on "my-push-consumer.orders"
order 2

22:50:01 [#3] Received on "my-push-consumer.orders"
other order ABCDEF