[Issue 53][PulsarSpout] Adds DLQ support in PulsarSpout of the Storm adaptor #1
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.
Fixes apache#53
Motivation
The current implementation of the Storm adaptor does not utilise the dead letter queue functionality of Pulsar. Often it may be desired that when there is some error while processing a message in the Storm topology, the message be moved into the dead letter queue so that it can be handled separately. But the PulsarSpout currently keeps retrying for a while & finally just drops the message by acking it, which leads to data loss. This PR seeks to allow users of PulsarSpout to opt in to using DLQ queues for message processing failures.
Modifications
negativeAcknowledge
to thePulsarSpoutConsumer
interface & added the implementation for the same in theSpoutConsumer
class.negativeAckFailedMessagesEnabled
in thePulsarSpoutConfiguration
class along with getter & setters for the same.PulsarSpoutDeadLetterPolicy
which has the same attributes & functionality as theDeadLetterPolicy
class exposed by the Pulsar library. This is primarily done to get around the fact that theDeadLetterPolicy
class is not serialisable.fail
,open
&mapToValueAndEmit
in thePulsarSpout
class to implement the DLQ functonalityVerifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation