-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Java Client] Fix DLQ message can not send when enable poolMessages #13280
base: master
Are you sure you want to change the base?
[Java Client] Fix DLQ message can not send when enable poolMessages #13280
Conversation
@@ -76,6 +76,7 @@ | |||
private BrokerEntryMetadata brokerEntryMetadata; | |||
|
|||
private boolean poolMessage; | |||
private boolean dlqMessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it is possible to not add this new field to MessageImpl.
A new field has a runtime weight.
if the problem is only about not "releasing" the message if it is send to the DLQ, what about simply "retaining" one more time before adding it to the possibleSendToDeadLetterTopicMessages
list ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only retain byteBuf is not enough. We have to not call recycle()
in release()
if the message was added to possibleSendToDeadLetterTopicMessages
list.
If message is acked by consumer as normal case, the message will not be added to possibleSendToDeadLetterTopicMessages
list and should be clear in release()
.
So how could we known whether this message was added to possibleSendToDeadLetterTopicMessages
list when user call release()
? If there is a way then we could remove this field.
0ea6abf
to
c4f7ee0
Compare
The pr had no activity for 30 days, mark with Stale label. |
The pr had no activity for 30 days, mark with Stale label. |
Motivation
Fixes #13269
Modifications
When message is put into
possibleSendToDeadLetterTopicMessages
, do not clear it inrelease()
since it will be used when send to DLQ later.And clear the message when it is removed from
possibleSendToDeadLetterTopicMessages
Verifying this change
This change is already covered by existing tests, such as PulsarSinkE2ETest.testPulsarSinkDLQ()
just enable poolMessage for client.
Documentation
no-need-doc
Only bug fix