Skip to main content
Version: 2.4.x

Flink Connector

This connector provides a sink that can send data to CnosDB.

Dependency requirements

Requires CnosDB 2.1.0 or later. Requires Java version 1.8 or higher.

First add the dependency to your project:


Code description

Create CnosDB configuration

CnosDBConfig cnosDBConfig = CnosDBConfig.builder()

Create CnosDBSink and add it to the Sink of Stream.

dataStream.addSink(new CnosDBSink(cnosDBConfig);

CnosDBSink accepts CnosDBPoint, which is actually the code implementation of LineProtocol.

new CnosDBPoint(measurement, timestamp, tags, fields);

Sample code

Sample code is here