@InterfaceAudience.Public @InterfaceStability.Stable public interface ServiceUrlProvider
This allows applications to retrieve the service URL from an external configuration provider and, more importantly, to force the Pulsar client to reconnect if the service URL has been changed.
It can be passed with ClientBuilder.serviceUrlProvider(ServiceUrlProvider)
Modifier and Type | Method and Description |
---|---|
String |
getServiceUrl()
Get the current service URL the Pulsar client should connect to.
|
void |
initialize(PulsarClient client)
Initialize the service url provider with Pulsar client instance.
|
void initialize(PulsarClient client)
This can be used by the provider to force the Pulsar client to reconnect whenever the service url might have
changed. See PulsarClient.updateServiceUrl(String)
.
client
- created pulsar client.String getServiceUrl()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.