接口 ServiceUrlProvider
-
@Public @Stable public interface ServiceUrlProvider
The provider to provide the service url.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)
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 java.lang.StringgetServiceUrl()Get the current service URL the Pulsar client should connect to.voidinitialize(PulsarClient client)Initialize the service url provider with Pulsar client instance.
-
-
-
方法详细资料
-
initialize
void initialize(PulsarClient client)
Initialize the service url provider with Pulsar client instance.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.
-
getServiceUrl
java.lang.String getServiceUrl()
Get the current service URL the Pulsar client should connect to.- 返回:
- the pulsar service url.
-
-