diff --git a/docs/client-libraries-cluster-level-failover.md b/docs/client-libraries-cluster-level-failover.md index f63cddc27a90..754362a877b1 100644 --- a/docs/client-libraries-cluster-level-failover.md +++ b/docs/client-libraries-cluster-level-failover.md @@ -66,7 +66,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException { .build(); PulsarClient pulsarClient = PulsarClient.builder() - .authentication(primaryAuthentication) + .serviceUrlProvider(failover) + .authentication(primaryAuthentication) .tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath) .build(); @@ -113,6 +114,7 @@ public PulsarClient getControlledFailoverClient() throws IOException { PulsarClient pulsarClient = PulsarClient.builder() + .serviceUrlProvider(provider) .build(); provider.initialize(pulsarClient); @@ -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*. \ No newline at end of file +3. Pulsar client 1 connects to cluster A using credential *c1*. diff --git a/versioned_docs/version-2.10.x/client-libraries-java.md b/versioned_docs/version-2.10.x/client-libraries-java.md index 6b5e81b49da7..0027a6b04071 100644 --- a/versioned_docs/version-2.10.x/client-libraries-java.md +++ b/versioned_docs/version-2.10.x/client-libraries-java.md @@ -376,7 +376,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException { .build(); PulsarClient pulsarClient = PulsarClient.builder() - .authentication(primaryAuthentication) + .serviceUrlProvider(failover) + .authentication(primaryAuthentication) .tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath) .build(); @@ -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; diff --git a/versioned_docs/version-2.11.x/client-libraries-java.md b/versioned_docs/version-2.11.x/client-libraries-java.md index d0b36370188c..8bc0753c502b 100644 --- a/versioned_docs/version-2.11.x/client-libraries-java.md +++ b/versioned_docs/version-2.11.x/client-libraries-java.md @@ -1238,7 +1238,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException { .build(); PulsarClient pulsarClient = PulsarClient.builder() - .authentication(primaryAuthentication) + .serviceUrlProvider(failover) + .authentication(primaryAuthentication) .tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath) .build(); @@ -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; diff --git a/versioned_docs/version-3.0.x/client-libraries-cluster-level-failover.md b/versioned_docs/version-3.0.x/client-libraries-cluster-level-failover.md index e84acc436b00..2b3a8c9f8be3 100644 --- a/versioned_docs/version-3.0.x/client-libraries-cluster-level-failover.md +++ b/versioned_docs/version-3.0.x/client-libraries-cluster-level-failover.md @@ -65,7 +65,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException { .build(); PulsarClient pulsarClient = PulsarClient.builder() - .authentication(primaryAuthentication) + .serviceUrlProvider(failover) + .authentication(primaryAuthentication) .tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath) .build(); @@ -112,6 +113,7 @@ public PulsarClient getControlledFailoverClient() throws IOException { PulsarClient pulsarClient = PulsarClient.builder() + .serviceUrlProvider(provider) .build(); provider.initialize(pulsarClient); @@ -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*. \ No newline at end of file +3. Pulsar client 1 connects to cluster A using credential *c1*. diff --git a/versioned_docs/version-3.1.x/client-libraries-cluster-level-failover.md b/versioned_docs/version-3.1.x/client-libraries-cluster-level-failover.md index e84acc436b00..2b3a8c9f8be3 100644 --- a/versioned_docs/version-3.1.x/client-libraries-cluster-level-failover.md +++ b/versioned_docs/version-3.1.x/client-libraries-cluster-level-failover.md @@ -65,7 +65,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException { .build(); PulsarClient pulsarClient = PulsarClient.builder() - .authentication(primaryAuthentication) + .serviceUrlProvider(failover) + .authentication(primaryAuthentication) .tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath) .build(); @@ -112,6 +113,7 @@ public PulsarClient getControlledFailoverClient() throws IOException { PulsarClient pulsarClient = PulsarClient.builder() + .serviceUrlProvider(provider) .build(); provider.initialize(pulsarClient); @@ -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*. \ No newline at end of file +3. Pulsar client 1 connects to cluster A using credential *c1*. diff --git a/versioned_docs/version-3.2.x/client-libraries-cluster-level-failover.md b/versioned_docs/version-3.2.x/client-libraries-cluster-level-failover.md index f63cddc27a90..754362a877b1 100644 --- a/versioned_docs/version-3.2.x/client-libraries-cluster-level-failover.md +++ b/versioned_docs/version-3.2.x/client-libraries-cluster-level-failover.md @@ -66,7 +66,8 @@ private PulsarClient getAutoFailoverClient() throws PulsarClientException { .build(); PulsarClient pulsarClient = PulsarClient.builder() - .authentication(primaryAuthentication) + .serviceUrlProvider(failover) + .authentication(primaryAuthentication) .tlsTrustCertsFilePath(primaryTlsTrustCertsFilePath) .build(); @@ -113,6 +114,7 @@ public PulsarClient getControlledFailoverClient() throws IOException { PulsarClient pulsarClient = PulsarClient.builder() + .serviceUrlProvider(provider) .build(); provider.initialize(pulsarClient); @@ -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*. \ No newline at end of file +3. Pulsar client 1 connects to cluster A using credential *c1*.