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

[fix][client] Make DeadLetterPolicy & KeySharedPolicy serializable #23718

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AnuragReddy2000
Copy link

@AnuragReddy2000 AnuragReddy2000 commented Dec 12, 2024

Fixes #23704

Motivation

We use the pulsar client to consume messages from a Pulsar broker in a Storm topology. Recently, we encountered an issue where the deadLetterPolicy that we set on the PulsarSpout seems to be lost when the topology is started. Upon investigation, we found that this is due to the deadLetterPolicy attribute in ConsumerConfigurationData being marked as transient. This prevents us from utilising the dead letter queue feature in our topology.

Modifications

Made DeadLetterPolicy, KeySharedPolicy and Range classes implement the java.io.Serializable interface and removed the transient keyword from the corresponding fields in the ConsumerConfigurationData class. In addition, two tests were also modified / updated.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Extended existing unit test for the ConsumerConfigurationData class to validate the retention of deadLetterPolicy through serialization & deserialization.

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

  • 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: AnuragReddy2000#1

@dao-jun
Copy link
Member

dao-jun commented Dec 13, 2024

oh, that is a unconventional use case I've been never seen. @lhotari Do you think is this change makes sense?

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good work @AnuragReddy2000

@AnuragReddy2000
Copy link
Author

/pulsarbot rerun-failure-checks

@AnuragReddy2000
Copy link
Author

@lhotari A test is failing on this PR which did not fail on the PR that raised in my fork. I checked the test, I'm not sure how my changes may cause it to fail. What do you suggest I do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] deadLetterPolicy attribute in the ConsumerConfigurationData class marked as transient
3 participants