public interface ConfigService
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(String dataId,
String group,
Listener listener)
Add a listener to the configuration, after the server modified the
configuration, the client will use the incoming listener callback.
|
String |
getConfig(String dataId,
String group,
long timeoutMs)
Get config
|
String |
getConfigAndSignListener(String dataId,
String group,
long timeoutMs,
Listener listener)
Get config and register Listener
If you want to pull it yourself when the program starts to get the configuration for the first time,
and the registered Listener is used for future configuration updates, you can keep the original
code unchanged, just add the system parameter: enableRemoteSyncConfig = "true" ( But there is network overhead);
therefore we recommend that you use this interface directly
|
String |
getServerStatus()
Get server status
|
boolean |
publishConfig(String dataId,
String group,
String content)
Publish config.
|
boolean |
removeConfig(String dataId,
String group)
Remove config
|
void |
removeListener(String dataId,
String group,
Listener listener)
Remove listener
|
String getConfig(String dataId, String group, long timeoutMs) throws NacosException
dataId - dataIdgroup - grouptimeoutMs - read timeoutNacosException - NacosExceptionString getConfigAndSignListener(String dataId, String group, long timeoutMs, Listener listener) throws NacosException
dataId - dataIdgroup - grouptimeoutMs - read timeoutlistener - ListenerNacosException - NacosExceptionvoid addListener(String dataId, String group, Listener listener) throws NacosException
dataId - dataIdgroup - grouplistener - listenerNacosException - NacosExceptionboolean publishConfig(String dataId, String group, String content) throws NacosException
dataId - dataIdgroup - groupcontent - contentNacosException - NacosExceptionboolean removeConfig(String dataId, String group) throws NacosException
dataId - dataIdgroup - groupNacosException - NacosExceptionvoid removeListener(String dataId, String group, Listener listener)
dataId - dataIdgroup - grouplistener - listenerString getServerStatus()
Copyright © 2018–2019 Alibaba Group. All rights reserved.