Kafka Connectors

This page describes the commands to manage Connectors in Lenses via the CLI.

The CLI can create, modify, pause, restart and remove Apache Kafka Connect connectors.

Kafka Connect cluster permissions will be applied to the operation.

View connectors

List the currently deployed connectors, optionally filter by name, cluster and namespace:

lenses-cli connectors --cluster-name="dev" 

#[[--names [--unwrap]]

The --names flag displays only the names of the connectors. When used with --unwrap, it will print each connector name on a separate line in the output.

List all the supported connectors

lenses-cli connectors --supported

View the available plugins per cluster

lenses-cli connectors plugins --cluster-name="dev"

Create connectors

lenses-cli connector create \
    --cluster-name="dev" \
    --name="connectorName" \
    --configs="{\"key\": \"value\"}"

From a file:

lenses-cli connector create ./connector.yaml

Example file:

clusterName: development
config:
  connector.class: "org.apache.kafka.connect.file.FileStreamSinkConnector"
  file: "/dev/null"
  tasks.max: "1"
  topics: "reddit_posts"
  name: "nullsink"

Update a connector

# Inline
lenses-cli connector update --name=nullsink --cluster-name=dev \
  --configs="{\"connector.class\":\"org.apache.kafka.connect.file.FileStreamSinkConnector\",\"file\":\"/dev/null\",\"name\":\"nullsink\",\"tasks.max\":\"8\",\"topics\":\"reddit_posts\"}"

# or from file
lenses-cli connector update ./connector.yaml

View the configuration of a connector

lenses-cli connector config \
    --cluster-name="dev" \
    --name="connectorName"

View the status of a connector

lenses-cli connector status \
    --cluster-name="dev" \
    --name="connectorName"

Pause a connector

lenses-cli connector pause \
    --cluster-name="dev" \
    --name="connectorName"

Resume a connector

lenses-cli connector resume \
    --cluster-name="dev" \
    --name="connectorName"

Last updated

Logo

2024 © Lenses.io Ltd. Apache, Apache Kafka, Kafka and associated open source project names are trademarks of the Apache Software Foundation.