From 1cdecfc05382239a71566690f7b5b7e4820c87bc Mon Sep 17 00:00:00 2001 From: Ivan Zakharchanka <3axap4eHko@gmail.com> Date: Sat, 9 Nov 2024 02:46:03 -0500 Subject: [PATCH] workflow fix --- .github/workflows/cicd.yml | 2 +- .github/workflows/upgrade.yml | 2 +- README.md | 22 ++++++++++++---------- package.json | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 2d00860..835af1f 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -9,6 +9,6 @@ jobs: - name: Run CI/CD Pipeline uses: zource-dev/action@v1 with: - node_version: '20.x' + node_version: '22.x' github_token: ${{ secrets.GITHUB_TOKEN }} codecov_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/upgrade.yml b/.github/workflows/upgrade.yml index 6fab461..fa039fc 100644 --- a/.github/workflows/upgrade.yml +++ b/.github/workflows/upgrade.yml @@ -12,7 +12,7 @@ jobs: - name: Run CI/CD Pipeline uses: zource-dev/action@v1 with: - node_version: '20.x' + node_version: '22.x' github_token: ${{ secrets.GITHUB_TOKEN }} autoupdate: minor username: Ivan Zakharchanka diff --git a/README.md b/README.md index f081961..5f9e31b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ npm install -g kafka-console ### Consumer -`kcli consume [options] ` +`npx kafka-console consume [options] ` #### Options ``` @@ -85,22 +85,24 @@ npm install -g kafka-console General usage with authentication ```sh -kcli consume $KAFKA_TOPIC -g $KAFKA_TOPIC_GROUP -b $KAFKA_BROKERS --ssl --mechanism plain --username $KAFKA_USERNAME --password $KAFKA_PASSWORD +npx kafka-console --brokers $KAFKA_BROKERS --ssl --mechanism plain --username $KAFKA_USERNAME --password $KAFKA_PASSWORD consume $KAFKA_TOPIC --group $KAFKA_TOPIC_GROUP ``` Stdout from timestamp `jq` example ```sh -kcli consume $KAFKA_TOPIC --from '1970-01-01T00:00:00.000Z' | jq .value +npx kafka-console consume $KAFKA_TOPIC --from 0 | jq .value ``` Custom data formatter example ```sh -kcli consume $KAFKA_TOPIC --data-format ./formatter/avro.js | jq +npx kafka-console consume $KAFKA_TOPIC --data-format ./formatter/avro.js | jq ``` ### Producer -`kcli produce [options] ` +```sh +npx kafka-console produce [options] +``` #### Options ``` @@ -113,22 +115,22 @@ kcli consume $KAFKA_TOPIC --data-format ./formatter/avro.js | jq General usage ```sh -kcli produce $KAFKA_TOPIC -b $KAFKA_BROKERS --ssl --mechanism plain --username $KAFKA_USERNAME --password $KAFKA_PASSWORD +npx kafka-console produce $KAFKA_TOPIC -b $KAFKA_BROKERS --ssl --mechanism plain --username $KAFKA_USERNAME --password $KAFKA_PASSWORD ``` Produce a json data from stdin with custom formatter ```sh -cat payload.txt|kcli produce $KAFKA_TOPIC --data-format ./formatter/avro.js +npx kafka-console payload.txt|kcli produce $KAFKA_TOPIC --data-format ./formatter/avro.js ``` Produce a json data from stdin ```sh -node payloadGenerator.js|kcli produce $KAFKA_TOPIC +node payloadGenerator.js|npx kafka-console produce $KAFKA_TOPIC ``` Produce a json array data from stdin ```sh -cat payload.json|jq -r -c .[]|kcli produce $KAFKA_TOPIC +cat payload.json|jq -r -c .[]|npx kafka-console produce $KAFKA_TOPIC ``` Payload single message input interface @@ -157,7 +159,7 @@ export interface Formatter { } ``` -## Environment +## Supported Environment Variables - KAFKA_BROKERS - KAFKA_TIMEOUT diff --git a/package.json b/package.json index 38a401c..b8d18a9 100644 --- a/package.json +++ b/package.json @@ -46,5 +46,5 @@ "evnty": "^2.1.106", "kafkajs": "^2.2.4" }, - "packageManager": "pnpm@9.12.3" + "packageManager": "pnpm@9" }