nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.1k stars 1.36k forks source link

After max_delivered attempts messages are not deleted from WQ Stream #5564

Closed souravagrawal closed 1 week ago

souravagrawal commented 1 week ago

Observed behavior

message which are failed to acknowledged by consumer even after max_redelivery attempts, are not getting deleted from WorkQueue Stream. Is it expected, if yes how to avoid this ?

Expected behavior

If acknowledge after max_delivery attempt is also not succesfull then NATS should mark the message deleted.

Server and client version

nats-server 2.10.5 nats-client 1.35.0

Host environment

macOS 12.3.1

Steps to reproduce

Create a WorkQueue Stream Create a PullBased Consumer with below configuration

Publish a message to stream Start a consumer and do not Ack the message, after all redelivery attempts message are not deleted from stream and consumer info shows no message to process.

derekcollison commented 1 week ago

This is correct behavior. That way the you can decide what to do with the message, in terms of deleting, retrying or moving to DLQ.