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

Add support for setting replicateSubscriptionState for the subscription #261

Merged
merged 2 commits into from Apr 19, 2024

Conversation

RobertIndie
Copy link
Contributor

Motivation

Apply apache/pulsar#4299 to pulsar-client-dotnet.

Introduce the replicateSubscriptionState setting in the ConsumerBuilder to allow subscription creation with replication enabled.

Modification

  • Add a new configuration to the ConsumerBuilder: ReplicateSubscriptionState

Verification

Include a test Successfully creating the replicated subscription to verify this modification.
The consumer should be able to set the ReplicateSubscriptionState as shown below:

            let! (_ : IConsumer<byte[]>) =
                client.NewConsumer()
                    .Topic(topicName)
                    .ConsumerName(consumerName)
                    .SubscriptionName("replicate")
                    .SubscriptionType(SubscriptionType.Shared)
                    .ReplicateSubscriptionState(true)       //         <- Set the ReplicateSubscriptionState
                    .SubscribeAsync()

Once subscribed, we should be able to view the replication state for the subscription.

image

@Lanayx Lanayx merged commit e0282f8 into fsprojects:develop Apr 19, 2024
2 checks passed
@Lanayx
Copy link
Collaborator

Lanayx commented Apr 19, 2024

Thanks! Published in 3.4.0

@RobertIndie
Copy link
Contributor Author

Hi @Lanayx , is it possible to move this change to 2.x and release a new version of 2.x?

@Lanayx
Copy link
Collaborator

Lanayx commented Apr 26, 2024

Hi, sure, you can make a PR to the 2.x branch and I will release it

RobertIndie added a commit to RobertIndie/pulsar-client-dotnet that referenced this pull request Apr 29, 2024
…tion (fsprojects#261)

* Add support for setting `replicateSubscriptionState` for the subscription

* Forward port 8080 for tests

(cherry picked from commit e0282f8)
@RobertIndie
Copy link
Contributor Author

Hi, sure, you can make a PR to the 2.x branch and I will release it

@Lanayx Thanks. I created the PR: #262

@RobertIndie RobertIndie deleted the replicate-state-sub branch April 29, 2024 07:45
Lanayx pushed a commit that referenced this pull request Apr 29, 2024
…tion (#261) (#262)

* Add support for setting `replicateSubscriptionState` for the subscription

* Forward port 8080 for tests

(cherry picked from commit e0282f8)
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.

None yet

2 participants