Skip to content
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

Dead letters incorrect processed for messages batch #5891

Closed
mprokushenkov opened this issue Dec 18, 2019 · 3 comments
Closed

Dead letters incorrect processed for messages batch #5891

mprokushenkov opened this issue Dec 18, 2019 · 3 comments
Labels
lifecycle/stale type/bug The PR fixed a bug or issue reported a bug

Comments

@mprokushenkov
Copy link

Describe the bug
Producer produces 10 messages. Consumer with set deads letters policy acks 9 messages and 1 nacks. This will lead to all 10 messages coming to dead letters topic.

To Reproduce
I'm testing scenario where producer sents messages using batch. Consumer with enabled dead letters policy acks all messages but nacks one message. Then another consumer receives messages from dead letters topic.

Steps to reproduce the behavior:

  1. Instanciate producer with enabled batching
  2. Instanciate consumer with enabled dead letters policy (maxRedeliverCount should be equals 0)
  3. Instanciate consumer for receiving messages from dead letters topic
  4. Send 10 messages
  5. Receive all messages and ack first 9 but nack for last (10)
  6. Receive messages from dead letters queue

Expected behavior
I expect that only nacked (10) message will be received from dead letters queue.

Screenshots
Here is a screenshot of log messages produced by steps specified above:

image

In [Step 3] only last (10) message should be received.

Desktop (please complete the following information):

  • OS: Windows
  • Environment: docker
  • Pulsar version: 2.4.1

Additional context
No additional context.

@mprokushenkov mprokushenkov added the type/bug The PR fixed a bug or issue reported a bug label Dec 18, 2019
@jiazhai
Copy link
Member

jiazhai commented Dec 19, 2019

Looking from the code, currently dead letter not support batch messages very well. a batch is handled as a unit. This is more of an enhancement requirements. ping @codelipenghui to confirm.

@gmethvin
Copy link
Member

I also noticed this after reporting essentially the same issue as #5969. I’d argue it’s a bug because the consumer APIs are defined on messages, not batches. At the very least it’s a bug because the documentation does not mention batches at all and suggests only the negatively acknowledged message will be redelivered. Even if the current behavior were correctly documented, though, it makes negative acknowledgements much less useful, as it puts an extra burden on the consumer of tracking duplicates.

@tisonkun
Copy link
Member

tisonkun commented Dec 9, 2022

Closed as stale. Please create a new issue if it's still relevant to the maintained versions.

@tisonkun tisonkun closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

5 participants