Skip to content

[fix][client] All chunkMessageIds sent to broker for redelivery#4

Open
berg223 wants to merge 1 commit intomasterfrom
fix_nack_chunk_redelivery
Open

[fix][client] All chunkMessageIds sent to broker for redelivery#4
berg223 wants to merge 1 commit intomasterfrom
fix_nack_chunk_redelivery

Conversation

@berg223
Copy link
Owner

@berg223 berg223 commented Feb 8, 2026

Fixes apache#25220

Motivation

There is an issue that chunked message cannot be redeliveryed for shared subscription mode. The client should send all chunk message ids to broker for redelivery but it hasn't. It only send the last chunk messageId and that's the root cause of this issue.

The problematic code path​​ is that:

    NegativeAcksTracker#triggerRedelivery
        UnAckedMessageTracker#addChunkedMessageIdsAndRemoveFromSequenceMap

In addChunkedMessageIdsAndRemoveFromSequenceMap method, all chunk messageIds should be fetched from consumerBase.unAckedChunkedMessageIdSequenceMap but it found nothing there. Actually, unAckedChunkedMessageIdSequenceMap has recorded the value by key which has type of ChunkMessageIdImpl. ChunkMessageIdImpl has a different hashcode from MessageIdImpl. That's why we found nothing there.

I have noticed that there is a nackedMessageIds map in NegativeAcksTracker. And it's convenient to record the origin messageId by nackedMessageIds which has a type of ChunkMessageIdImpl.

Modifications

Record the origin messageId by the map nackedMessageIds in NegativeAcksTracker

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

MessageChunkingSharedTest#testNegativeAckChunkedMessage

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:
#4

@codecov
Copy link

codecov bot commented Feb 9, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

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.

[Bug] [java client] Nacked chunked messages do not get redelivered

1 participant