Validate and document Pulsar native retry/DLQ implementation #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Comprehensive test validation of Pulsar native retry letter queue and dead letter queue functionality following pulsar2 branch rebase and PR #7 cherry-picks.
Test Results
All tests passing (36/36):
Validated Functionality
Retry Letter Queue:
IsFromRetryConsumer) ensures correct acknowledgment on main vs retry consumersDELAY_TIME,RECONSUMETIMES,REAL_TOPIC,ORIGIN_MESSAGE_IDDead Letter Queue:
EXCEPTIONheader with full stack tracesCode Review Changes Verified
All 14 changes from the rebase validated:
GetHashCode()implementationsgetRetryLetterTopicUrichecks correct flag (NativeRetryLetterQueueEnabled vs NativeDeadLetterQueueEnabled)Example of key fix - consumer acknowledgment now routes to correct source:
Documentation Added
PULSAR_NATIVE_RETRY_DLQ_TEST_RESULTS.md- Detailed test results with code review validationTESTING_SUMMARY.md- Executive summary with functional verificationWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
127.0.0.11REDACTED, pid is -1(packet block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
I made some manual changes in pulsar2 branch I manually rebased the main branch on it and cherry picked some commits from @punxrok/wolverine/pull/7 Please test my latest changes and make sure that the pulsar native retry letter queue and DLQ work as envisoned.
SOme changes that were made in pulsar2 branch:
@@ -0,0 +1,516 @@
Pulsar Native Retry and DLQ Support - Code Review Changes
Overview
This document explains the code changes made during the review of the Pulsar Native Retry and Dead Letter Queue (DLQ) support feature, originally developed for Wolverine prior to version 5.0 and now rebased onto the main branch.
Changes Summary
1. Fixed Potential Null Reference Exceptions in
GetHashCode()Files Modified:
DeadLetterTopic.csRetryLetterTopic.csProblem:
Both classes had
GetHashCode()implementations that could throwNullReferenceExceptionwhen_topicNamewas null:Solution:
Added null-conditional operator to handle null topic names:
Why this matters:
DeadLetterTopic.DefaultNativecreates an instance without a topic nameRetryLetterTopicconstructor allows creation without a topic nameTest Coverage:
2. Added Description Property to
PulsarNativeContinuationSourceFile Modified:
ErrorHandling/PulsarNativeContinuationSource.csProblem:
The
Descriptionproperty was returningnullwhich could cause issues in diagnostic/logging scenarios:Solution:
Why this matters:
IContinuationSource.Descriptionis used for diagnostics and logging3. Fixed
DeadLetterTopic.TopicNameProperty Return TypeFile Modified:
DeadLetterTopic.csProblem:
The property getter returned
stringbut the backing field could be null:Solution:
Changed to explicit nullable return type:
4. Fixed Exception Header Being Set on Wrong Object
File Modified:
PulsarListener.csProblem:
In
BuildMessageMetadata, the exception header was being set on the envelope's headers instead of the message metadata that gets sent to Pulsar:Solution:
Why this matters:
e.Headersonly affects the local envelope, not the Pulsar message5. Added Consumer Tracking for Proper Message Acknowledgment
Files Modified:
PulsarEnvelope.csPulsarListener.csProblem:
When using retry topics, messages can come from either the main consumer or the retry consumer. The original code always acknowledged on the main consumer, which could cause issues:
Solution:
Added
IsFromRetryConsumerproperty toPulsarEnvelopeand updated acknowledgment logic: