Skip to content

Add command topic Deduplication(#246) - #408

Merged
zymap merged 2 commits into
streamnative:masterfrom
limingnihao:deduplication
Aug 4, 2021
Merged

zymap merged 2 commits into
streamnative:masterfrom
limingnihao:deduplication

Conversation

@limingnihao

Copy link
Copy Markdown
Contributor

Add command topic Deduplication:

  • pulsarctl topics get-deduplication [topic]
  • pulsarctl topics set-deduplication [topic] -e
  • pulsarctl topics remove-deduplication [topic]

- pulsarctl topics get-deduplication [topic]
- pulsarctl topics set-deduplication [topic] -e
- pulsarctl topics remove-deduplication [topic]
@limingnihao
limingnihao requested review from a team and zymap as code owners August 2, 2021 05:28
admin := cmdutils.NewPulsarClient()
err = admin.Topics().SetDeduplicationStatus(*topic, enable)
if err == nil {
vc.Command.Printf("Set the deduplication policy successfully for [%s]\n", topic.String())

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.

Add the enable or disable in the output?

var examples []cmdutils.Example
msg := cmdutils.Example{
Desc: "Set the deduplication policy for a topic",
Command: "pulsarctl topics set-deduplication topic ",

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.

Add the enable and the disable examples?

)

func TestDeduplicationStatus(t *testing.T) {
topicName := "persistent://public/default/test-deduplication-status-topic"

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.

Could you please add a random suffix on the topic name? You can use the test.RandomSuffix()

Signed-off-by: limingnihao <[email protected]>
@zymap
zymap merged commit a529093 into streamnative:master Aug 4, 2021
nodece pushed a commit that referenced this pull request Nov 12, 2021
* Add command topic Deduplication(#246)

- pulsarctl topics get-deduplication [topic]
- pulsarctl topics set-deduplication [topic] -e
- pulsarctl topics remove-deduplication [topic]

* Modify prompt

Signed-off-by: limingnihao <[email protected]>
(cherry picked from commit a529093)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants