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.
View connectors
List the currently deployed connectors, optionally filter by name, cluster and namespace:
Copy 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
Copy lenses-cli connectors --supported
View the available plugins per cluster
Copy lenses-cli connectors plugins --cluster-name="dev"
Create connectors
Copy lenses-cli connector create \
--cluster-name="dev" \
--name="connectorName" \
--configs="{\"key\": \"value\"}"
From a file:
Copy lenses-cli connector create ./connector.yaml
Example file:
Copy 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
Copy # 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
Copy lenses-cli connector config \
--cluster-name="dev" \
--name="connectorName"
View the status of a connector
Copy lenses-cli connector status \
--cluster-name="dev" \
--name="connectorName"
Pause a connector
Copy lenses-cli connector pause \
--cluster-name="dev" \
--name="connectorName"
Resume a connector
Copy lenses-cli connector resume \
--cluster-name="dev" \
--name="connectorName"