Replies: 3 comments 2 replies
-
Hello @dvaldivia In general, when you use I went through the example you provided an I noticed one inconsistency - when creating the subscription, you are setting the durable consumer name to sub, err := js.PullSubscribe(topic, "audit-stream") While this is certainly possible, I am wondering if that is not a mistake, since later on I see that you are checking a different consumer using nats cli ( nats consumer info audit-stream logs-stream Also, since you are using I tried reproducing your issue with this simple program - https://gist.github.com/piotrpio/9f023c71a317d446acfc817352cc7e6a After starting it, I tried publishing some messages on If your issue persists, it would be good if you provide your client and server versions (I am using [email protected] and [email protected]). As to your other question:
No, you don't need to use Let me know if it works for you. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply @piotrpio the original Stream didn't had the the stream name mismatch was because I original was trying to setup one stream per topic but then I realized I could ask for multiple topics under one stream and then have two separate I'm using the latest and greatest versions of After starting the code, I get that the stream already exist and when getting the consumer information linfo, err := lib.GetInstance().Js.ConsumerInfo("audit-stream", "logs-stream") I still see 21 pending messages, even if I comment the {
"stream_name": "audit-stream",
"name": "logs-stream",
"created": "2023-01-27T19:08:31.104258Z",
"config": {
"durable_name": "logs-stream",
"name": "logs-stream",
"deliver_policy": "all",
"ack_policy": "explicit",
"ack_wait": 30000000000,
"max_deliver": -1,
"filter_subject": "logs",
"replay_policy": "instant",
"max_waiting": 512,
"max_ack_pending": 65536,
"num_replicas": 0
},
"delivered": {
"consumer_seq": 8,
"stream_seq": 8
},
"ack_floor": {
"consumer_seq": 8,
"stream_seq": 8
},
"num_ack_pending": 0,
"num_redelivered": 0,
"num_waiting": 0,
"num_pending": 21
} |
Beta Was this translation helpful? Give feedback.
-
Faced the same issue and found the cause: I didn't mark messages as acknowledged |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm creating a durable stream and then a Pull Consumer that fetches messages every X seconds, the first time the stream gets created, everything works fine, however, if I restart the consumer code, no message gets delivered, and I can see in the
ConsumerInfo
that some messages are waiting to be pulled but the consumer itself does nothing, unless I restart thenats-server
How I'm adding the stream
How I'm consuming the stream
stuck messages
at this point, this consumer doesn't receive any messages after restart.
How can I have this code resume fetching messages? I expect this code to have multiple concurrent consumers on the same topic, so I assume this could be a problem with more consumers.
Additional question: do I need to bind the stream when creating the consumer like
Beta Was this translation helpful? Give feedback.
All reactions