Skip to content

[fix][java-client] Make DeadLetterPolicy deserializable - #16513

Merged
Technoboy- merged 2 commits into
apache:masterfrom
coderzc:fix_issues_16487
Jul 13, 2022
Merged

[fix][java-client] Make DeadLetterPolicy deserializable#16513
Technoboy- merged 2 commits into
apache:masterfrom
coderzc:fix_issues_16487

Conversation

@coderzc

@coderzc coderzc commented Jul 11, 2022

Copy link
Copy Markdown
Member

Fixes #16487

Motivation

DeadLetterPolicy can't deserialization, the root cause is DeadLetterPolicy without a No-argument constructor.

Modifications

Add @NoArgsConstructor and @AllArgsConstructor annotates for DeadLetterPolicy.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as testDeadLetterPolicyDeserialize.

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)
  • The rest endpoints: (yes / no)
  • The admin cli options: (yes / no)
  • Anything that affects deployment: (yes / no / don't know)

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jul 11, 2022
@Technoboy-

Copy link
Copy Markdown
Contributor

Why not only add @NoArgsConstructor?

@coderzc

coderzc commented Jul 11, 2022

Copy link
Copy Markdown
Member Author

Why not only add @NoArgsConstructor?

Because @Builder needs @AllArgsConstructor if add @NoArgsConstructor

DeadLetterPolicy policy =
DeadLetterPolicy.builder().deadLetterTopic("a").retryLetterTopic("a").initialSubscriptionName("a")
.maxRedeliverCount(1).build();
consumerBuilder.deadLetterPolicy(policy);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you want to add policy in the config map?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want test DeadLetterPolicy deserialization

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it.

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gaoran10 gaoran10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@codelipenghui codelipenghui added this to the 2.11.0 milestone Jul 12, 2022
@codelipenghui codelipenghui changed the title [fix][client] Make DeadLetterPolicy deserializable [fix][java-client] Make DeadLetterPolicy deserializable Jul 12, 2022
@Technoboy-
Technoboy- merged commit abe4350 into apache:master Jul 13, 2022
gaozhangmin pushed a commit to gaozhangmin/pulsar that referenced this pull request Jul 14, 2022
@michaeljmarshall

Copy link
Copy Markdown
Member

Thanks @coderzc!

wuxuanqicn pushed a commit to wuxuanqicn/pulsar that referenced this pull request Jul 14, 2022
codelipenghui pushed a commit that referenced this pull request Jul 15, 2022
mattisonchao pushed a commit that referenced this pull request Jul 15, 2022
@mattisonchao mattisonchao added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jul 15, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jul 19, 2022
(cherry picked from commit abe4350)
(cherry picked from commit de54ef6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 doc-not-needed Your PR changes do not impact docs release/2.9.4 release/2.10.2 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make DeadLetterPolicy deserializable

8 participants