public class NacosDataSource<T> extends AbstractDataSource<String,T>
DataSource with Nacos backend. When the data in Nacos backend has been modified,
Nacos will automatically push the new value so that the dynamic configuration can be real-time.parser, property| Constructor and Description |
|---|
NacosDataSource(Properties properties,
String groupId,
String dataId,
Converter<String,T> parser) |
NacosDataSource(String serverAddr,
String groupId,
String dataId,
Converter<String,T> parser)
Constructs an read-only DataSource with Nacos backend.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
readSource() |
getProperty, loadConfig, loadConfigpublic NacosDataSource(String serverAddr, String groupId, String dataId, Converter<String,T> parser)
serverAddr - server address of Nacos, cannot be emptygroupId - group ID, cannot be emptydataId - data ID, cannot be emptyparser - customized data parser, cannot be emptypublic NacosDataSource(Properties properties, String groupId, String dataId, Converter<String,T> parser)
properties - properties for construct ConfigService using NacosFactory.createConfigService(Properties)groupId - group ID, cannot be emptydataId - data ID, cannot be emptyparser - customized data parser, cannot be emptyCopyright © 2021 Alibaba Group. All rights reserved.