Skip to content

Instantly share code, notes, and snippets.

@helpermethod
Last active September 29, 2020 13:19
Show Gist options
  • Save helpermethod/0fc934df287477a28ffe78a897ce3c05 to your computer and use it in GitHub Desktop.
Save helpermethod/0fc934df287477a28ffe78a897ce3c05 to your computer and use it in GitHub Desktop.
Kafka Connect Source Connector Reset
kafkacat -q -e -b localhost:9092 -t connect-offsets -f '%p#%k\n' | {
  while IFS=# read -r partition key; do
    # replace connector_name with the actual connector name
    if [[ $key =~ '["connector_name",' ]]; then
      echo "echo '$key#' | kafkacat -b localhost:9092 -t connect-offsets -P -Z -K# -p $partition" && exit
    fi
  done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment