use of com.couchbase.connect.kafka.config.source.CouchbaseSourceConfig in project kafka-connect-couchbase by couchbase.
the class CouchbaseSourceConnector method start.
@Override
public void start(Map<String, String> properties) {
try {
configProperties = properties;
CouchbaseSourceConfig config = ConfigHelper.parse(CouchbaseSourceConfig.class, properties);
try (KafkaCouchbaseClient client = new KafkaCouchbaseClient(config)) {
Bucket bucket = client.bucket();
bucketConfig = (CouchbaseBucketConfig) CouchbaseHelper.getConfig(bucket, config.bootstrapTimeout());
String connectionString = String.join(",", config.seedNodes());
NetworkResolution network = NetworkResolution.valueOf(config.network());
seedNodes = SeedNodeHelper.getKvNodes(bucket, connectionString, config.enableTls(), network, config.bootstrapTimeout());
}
} catch (ConfigException e) {
throw new ConnectException("Cannot start CouchbaseSourceConnector due to configuration error", e);
}
}
Aggregations