Skip to content

[FIXED] Don't report redeliveries for consumer with MaxDeliver 1 #6877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

Conversation

MauriceVanVeen
Copy link
Member

A consumer with MaxDeliver: 1 reports non-acked messages as Redelivered Messages, although no redeliveries have happened. The state is still preserved, otherwise unacked messages in an Interest stream can be lost if used for DLQ (#6538). But we don't report redeliveries anymore for this case.

Resolves #6874

Signed-off-by: Maurice van Veen [email protected]

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner May 7, 2025 13:58
Copy link

@ro0NL ro0NL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im wondering if the server can expose both numbers (currently our app interpreters 'redeliveries' as 'pending messages/acks')

@MauriceVanVeen
Copy link
Member Author

im wondering if the server can expose both numbers (currently our app interpreters 'redeliveries' as 'pending messages/acks')

The server already exposes that through NumPending, which is the pending (not delivered yet) messages, andNumAckPending, the messages that are waiting for acks.

@ro0NL
Copy link

ro0NL commented May 7, 2025

Im not seeing it in nats schema info io.nats.jetstream.api.v1.stream_info_response

However, it does confirm stream.info.state.messages is the current no. of messages stored in the queue:

              "properties": {
                "messages": {
                  "description": "Number of messages stored in the Stream",

in our case this exposes 10 (redelivered, 0 as per this PR, but we seek the no. of pending acks generally).

@MauriceVanVeen
Copy link
Member Author

That is stream info, not consumer info:

nats schema info io.nats.jetstream.api.v1.consumer_info_response

@ro0NL
Copy link

ro0NL commented May 7, 2025

We need to indeed use the consumer info 👍 fixed on our side also.

I dont understand the difference between NumPending and NumAckPending quite yet, in our case we see:

        Outstanding Acks: 0
    Redelivered Messages: 0
    Unprocessed Messages: 2

given 2 dispatches. When we ack 1, we see:

        Outstanding Acks: 0
    Redelivered Messages: 0
    Unprocessed Messages: 1

@MauriceVanVeen
Copy link
Member Author

@ro0NL, Let's take this discussion out of this PR and back into the issue: #6874 (comment)

Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neilalexander neilalexander merged commit 516fda6 into main May 8, 2025
110 of 114 checks passed
@neilalexander neilalexander deleted the maurice/consumer-maxdc1-reporting branch May 8, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected number of Redelivered Messages for consumer
3 participants