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][doc] Fixes example code in Cluster Failover Java Client #891

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/client-libraries-cluster-level-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException {
.build();

PulsarClient pulsarClient = PulsarClient.builder()
.authentication(primaryAuthentication)
.serviceUrlProvider(failover)
.authentication(primaryAuthentication)
.tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath)
.build();

Expand Down Expand Up @@ -113,6 +114,7 @@ public PulsarClient getControlledFailoverClient() throws IOException {

PulsarClient pulsarClient =
PulsarClient.builder()
.serviceUrlProvider(provider)
.build();

provider.initialize(pulsarClient);
Expand Down Expand Up @@ -155,4 +157,4 @@ Assume that you want to connect Pulsar client 1 to cluster A.
}
```

3. Pulsar client 1 connects to cluster A using credential *c1*.
3. Pulsar client 1 connects to cluster A using credential *c1*.
7 changes: 5 additions & 2 deletions versioned_docs/version-2.10.x/client-libraries-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException {
.build();

PulsarClient pulsarClient = PulsarClient.builder()
.authentication(primaryAuthentication)
.serviceUrlProvider(failover)
.authentication(primaryAuthentication)
.tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath)
.build();

Expand Down Expand Up @@ -419,7 +420,9 @@ public PulsarClient getControlledFailoverClient() throws IOException {
.urlProviderHeader(header)
.build();

PulsarClient pulsarClient = PulsarClient.builder().build();
PulsarClient pulsarClient = PulsarClient.builder()
.serviceUrlProvider(provider)
.build();

provider.initialize(pulsarClient);
return pulsarClient;
Expand Down
7 changes: 5 additions & 2 deletions versioned_docs/version-2.11.x/client-libraries-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException {
.build();

PulsarClient pulsarClient = PulsarClient.builder()
.authentication(primaryAuthentication)
.serviceUrlProvider(failover)
.authentication(primaryAuthentication)
.tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath)
.build();

Expand Down Expand Up @@ -1281,7 +1282,9 @@ public PulsarClient getControlledFailoverClient() throws IOException {
.urlProviderHeader(header)
.build();

PulsarClient pulsarClient = PulsarClient.builder().build();
PulsarClient pulsarClient = PulsarClient.builder()
.serviceUrlProvider(provider)
.build();

provider.initialize(pulsarClient);
return pulsarClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException {
.build();

PulsarClient pulsarClient = PulsarClient.builder()
.authentication(primaryAuthentication)
.serviceUrlProvider(failover)
.authentication(primaryAuthentication)
.tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath)
.build();

Expand Down Expand Up @@ -112,6 +113,7 @@ public PulsarClient getControlledFailoverClient() throws IOException {

PulsarClient pulsarClient =
PulsarClient.builder()
.serviceUrlProvider(provider)
.build();

provider.initialize(pulsarClient);
Expand Down Expand Up @@ -154,4 +156,4 @@ Assume that you want to connect Pulsar client 1 to cluster A.
}
```

3. Pulsar client 1 connects to cluster A using credential *c1*.
3. Pulsar client 1 connects to cluster A using credential *c1*.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException {
.build();

PulsarClient pulsarClient = PulsarClient.builder()
.authentication(primaryAuthentication)
.serviceUrlProvider(failover)
.authentication(primaryAuthentication)
.tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath)
.build();

Expand Down Expand Up @@ -112,6 +113,7 @@ public PulsarClient getControlledFailoverClient() throws IOException {

PulsarClient pulsarClient =
PulsarClient.builder()
.serviceUrlProvider(provider)
.build();

provider.initialize(pulsarClient);
Expand Down Expand Up @@ -154,4 +156,4 @@ Assume that you want to connect Pulsar client 1 to cluster A.
}
```

3. Pulsar client 1 connects to cluster A using credential *c1*.
3. Pulsar client 1 connects to cluster A using credential *c1*.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException {
.build();

PulsarClient pulsarClient = PulsarClient.builder()
.authentication(primaryAuthentication)
.serviceUrlProvider(failover)
.authentication(primaryAuthentication)
.tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath)
.build();

Expand Down Expand Up @@ -113,6 +114,7 @@ public PulsarClient getControlledFailoverClient() throws IOException {

PulsarClient pulsarClient =
PulsarClient.builder()
.serviceUrlProvider(provider)
.build();

provider.initialize(pulsarClient);
Expand Down Expand Up @@ -155,4 +157,4 @@ Assume that you want to connect Pulsar client 1 to cluster A.
}
```

3. Pulsar client 1 connects to cluster A using credential *c1*.
3. Pulsar client 1 connects to cluster A using credential *c1*.
Loading