This project is a command-line client for Kafka Connect. Relying on the idioms and semantics of kubectl, it allows you to register and examine connectors, delete them, restart them, etc. You can see what kcctl is about in this short video:
You can obtain early access binaries of kcctl (x86) for Linux, macOS, and Windows from here. This is a rolling release, new binaries are published upon each commit pushed to the kcctl repository.
Note: on macOS, you need to remove the quarantine flag after downloading, as the distribution currently is not signed:
xattr -r -d com.apple.quarantine path /to/kcctl-1.0.0-SNAPSHOT-osx-x86_64/We're planning to publish kcctl binaries via SDKMAN! soon, too.
It is recommended to install the bash/zsh completion script kcctl_completion:
. kcctl_completionDisplay the help to learn about using kcctl:
kcctl help
Usage: kcctl [-hV] [COMMAND]
A command-line interface for Kafka Connect
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
info Displays information about the Kafka Connect cluster
config Sets or retrieves the configuration of this client
get Displays information about connector plug-ins, connectors, and
loggers
describe Displays detailed information about the specified resource
apply Applies the given file for registering or updating a connector
patch Modifies the configuration of a connector or logger
restart Restarts a connector or task
pause Pauses a connector
resume Resumes a connector
delete Deletes the specified connector
help Displays help information about the specified commandThis project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
You can run your application in dev mode that enables live coding using:
./mvnw compile quarkus:devTo seed the command line arguments, pass the -Dquarkus.args option:
./mvnw compile quarkus:dev -Dquarkus.args='patch get connectors'In dev mode, remote debuggers can connect to the running application on port 5005.
In order to wait for a debugger to connect, pass the -Dsuspend option.
The application can be packaged using:
./mvnw packageIt produces the quarkus-run.jar file in the target/quarkus-app/ directory.
Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.
The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar.
You should define an alias kcctl:
alias kcctl="java -jar target/quarkus-app/quarkus-run.jar"You can create a native executable using:
./mvnw package -PnativeYou can then execute your native executable with: ./target/code-with-quarkus-1.0.0-SNAPSHOT-runner
As above, either define an alias kcctl or rename the resulting executable accordingly.
Build the application in JVM mode. Then recreate the completion script:
java -cp "target/quarkus-app/app/*:target/quarkus-app/lib/main/*:target/quarkus-app/quarkus-run.jar" \
picocli.AutoComplete -n kcctl --force dev.morling.kccli.command.KcCtlCommandEdit the completion scrpt kcctl_completion, replace all the quotes around generated completion invocations with back ticks, making them actual invocations of kcctl::
--- local CONNECTOR_NAME_pos_param_args="kcctl connector-name-completions" # 0-0 values
+++ local CONNECTOR_NAME_pos_param_args=`kcctl connector-name-completions` # 0-0 valuesCurrently, three kinds of completions exist: connector-name-completions, task-name-completions, and logger-name-completions.
- Picocli (guide): Develop command line applications with Picocli
- Quarkus native apps (guide): Develop native applications with Quarkus and GraalVM
This code base is available ander the Apache License, version 2.
