Skip to main content

Connector

A Connector in Nstream AI enables seamless integration between streaming data sources and sink. It supports streaming technologies like Kafka, ensuring efficient data flow and processing.

Sink Connector

A Kafka-based sink connector configuration for writing data into a specific topic with SSL authentication.

apiVersion: streams.nstream.ai/v1
kind: StreamConnector
metadata:
name: "NAME"
namespace: "NAMESPACE"
spec:
streamConnectorTemplate:
kafka:
connectorConfig:
groupId: "groupId"
keyFormat: "string"
valueFormat: "JSON"
offsetResetStrategy: "EARLIEST"
connectorParams:
bootstrapUrl: "URL"
topic: "TOPIC"
securityProtocol: "SASL_SSL"
saslMechanism: "PLAIN"
saslSslConfig:
jksKeystoreFile: "/path/to/keystore.jks"
jksKeystorePassword: "keystore-password"
jksTruststoreFile: "/path/to/truststore.jks"
jksTruststorePassword: "truststore-password"
KeyDescriptionExample
apiVersionDefines the API version for connector deploymentstreams.nstream.ai/v1
kindSpecifies the type of connector being deployedStreamConnector
nameThe unique name of the connector instancedemo-sink-connector
groupIdConsumer group ID for Kafkademo-sink-group
keyFormatFormat of the keystring
valueFormatFormat of the valueJSON
offsetResetStrategyOffset reset strategyEARLIEST
bootstrapUrlKafka bootstrap server URLns-data-system-kafka-bootstrap.kafka.svc.cluster.local:9092
topicKafka topic nameticker_demo_sink
securityProtocolSecurity protocol usedSASL_SSL
saslMechanismSASL mechanism usedPLAIN
jksKeystoreFilePath to Keystore file/path/to/keystore.jks
jksKeystorePasswordPassword for Keystore filekeystore-password
jksTruststoreFilePath to Truststore file/path/to/truststore.jks
jksTruststorePasswordPassword for Truststore filetruststore-password

Source Connector

A Kafka-based source connector configuration for ingesting data into Nstream AI with schema definition.

apiVersion: streams.nstream.ai/v1
kind: StreamConnector
metadata:
name: "NAME"
namespace: "NAMESPACE"
spec:
streamConnectorType: Kafka
streamConnectorSchema:
schemaId: "schemaId"
definition:
- key: "KEY"
dataType: "DATATYPE"
nullable: false
watermarkColumn: "KEY"
groupingColumn: ["KEY"]
watermarkDuration: 5
primaryKey: "PRIMARYKEY"
streamConnectorTemplate:
kafka:
connectorConfig:
groupId: "groupId"
keyFormat: "string"
valueFormat: "json"
offsetResetStrategy: "LATEST"
offsetStartValue:
partition: 0
offset: 0
connectorParams:
bootstrapUrl: "URL"
topic: "TOPIC"
securityProtocol: "NONE"
KeyDescriptionExample
apiVersionDefines the API version for connector deploymentstreams.nstream.ai/v1
kindSpecifies the type of connector being deployedStreamConnector
nameThe unique name of the connector instanceevent-source-connector
namespaceNamespace where the connector is deployednstream
streamConnectorTypeType of streaming connectorKafka
schemaIdID of the schema usedexample-schema-id
definition.keySchema field keyevent_data
definition.dataTypeData type of schema fieldSTRING
watermarkColumnColumn used for watermarkingdatetime
groupingColumnColumn used for grouping[event_data]
watermarkDurationWatermark interval duration5
primaryKeyPrimary key fieldevent_data
groupIdConsumer group ID for Kafkaevent-source-connector-consumer-group
keyFormatFormat of the keystring
valueFormatFormat of the valuejson
offsetResetStrategyOffset reset strategyLATEST
offsetStartValue.partitionPartition to start reading from0
offsetStartValue.offsetOffset value to start from0
bootstrapUrlKafka bootstrap server URLns-data-system-kafka-bootstrap.kafka.svc.cluster.local:9092
topicKafka topic nameticker_demo_node_1
securityProtocolSecurity protocol usedNONE