Skip to content

Commit

Permalink
workflow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
3axap4eHko committed Nov 9, 2024
1 parent e6d18ad commit 1cdecfc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ npm install -g kafka-console

### Consumer

`kcli consume [options] <topic>`
`npx kafka-console consume [options] <topic>`

#### Options
```
Expand All @@ -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] <topic>`
```sh
npx kafka-console produce [options] <topic>
```

#### Options
```
Expand All @@ -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
Expand Down Expand Up @@ -157,7 +159,7 @@ export interface Formatter<T> {
}
```

## Environment
## Supported Environment Variables

- KAFKA_BROKERS
- KAFKA_TIMEOUT
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
"evnty": "^2.1.106",
"kafkajs": "^2.2.4"
},
"packageManager": "pnpm@9.12.3"
"packageManager": "pnpm@9"
}

0 comments on commit 1cdecfc

Please sign in to comment.