kafka-console 2.0.19 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/build/commands/consume.js +17 -7
- package/build/commands/produce.js +17 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ npm install -g kafka-console
|
|
|
70
70
|
|
|
71
71
|
### Consumer
|
|
72
72
|
|
|
73
|
-
`
|
|
73
|
+
`npx kafka-console consume [options] <topic>`
|
|
74
74
|
|
|
75
75
|
#### Options
|
|
76
76
|
```
|
|
@@ -85,22 +85,24 @@ npm install -g kafka-console
|
|
|
85
85
|
|
|
86
86
|
General usage with authentication
|
|
87
87
|
```sh
|
|
88
|
-
|
|
88
|
+
npx kafka-console --brokers $KAFKA_BROKERS --ssl --mechanism plain --username $KAFKA_USERNAME --password $KAFKA_PASSWORD consume $KAFKA_TOPIC --group $KAFKA_TOPIC_GROUP
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Stdout from timestamp `jq` example
|
|
92
92
|
```sh
|
|
93
|
-
|
|
93
|
+
npx kafka-console consume $KAFKA_TOPIC --from 0 | jq .value
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Custom data formatter example
|
|
97
97
|
```sh
|
|
98
|
-
|
|
98
|
+
npx kafka-console consume $KAFKA_TOPIC --data-format ./formatter/avro.js | jq
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
### Producer
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
```sh
|
|
104
|
+
npx kafka-console produce [options] <topic>
|
|
105
|
+
```
|
|
104
106
|
|
|
105
107
|
#### Options
|
|
106
108
|
```
|
|
@@ -113,22 +115,22 @@ kcli consume $KAFKA_TOPIC --data-format ./formatter/avro.js | jq
|
|
|
113
115
|
|
|
114
116
|
General usage
|
|
115
117
|
```sh
|
|
116
|
-
|
|
118
|
+
npx kafka-console produce $KAFKA_TOPIC -b $KAFKA_BROKERS --ssl --mechanism plain --username $KAFKA_USERNAME --password $KAFKA_PASSWORD
|
|
117
119
|
```
|
|
118
120
|
|
|
119
121
|
Produce a json data from stdin with custom formatter
|
|
120
122
|
```sh
|
|
121
|
-
|
|
123
|
+
npx kafka-console payload.txt|kcli produce $KAFKA_TOPIC --data-format ./formatter/avro.js
|
|
122
124
|
```
|
|
123
125
|
|
|
124
126
|
Produce a json data from stdin
|
|
125
127
|
```sh
|
|
126
|
-
node payloadGenerator.js|
|
|
128
|
+
node payloadGenerator.js|npx kafka-console produce $KAFKA_TOPIC
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
Produce a json array data from stdin
|
|
130
132
|
```sh
|
|
131
|
-
cat payload.json|jq -r -c .[]|
|
|
133
|
+
cat payload.json|jq -r -c .[]|npx kafka-console produce $KAFKA_TOPIC
|
|
132
134
|
```
|
|
133
135
|
|
|
134
136
|
Payload single message input interface
|
|
@@ -157,7 +159,7 @@ export interface Formatter<T> {
|
|
|
157
159
|
}
|
|
158
160
|
```
|
|
159
161
|
|
|
160
|
-
## Environment
|
|
162
|
+
## Supported Environment Variables
|
|
161
163
|
|
|
162
164
|
- KAFKA_BROKERS
|
|
163
165
|
- KAFKA_TIMEOUT
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kafka-console",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.20",
|
|
4
4
|
"description": "Kafka CLI tool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"jest": "^29.7.0",
|
|
40
40
|
"ts-jest": "^29.2.5",
|
|
41
41
|
"ts-node": "^10.9.2",
|
|
42
|
-
"typescript": "^5.
|
|
42
|
+
"typescript": "^5.7.2"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"commander": "^12.1.0",
|
|
46
46
|
"evnty": "^2.1.106",
|
|
47
47
|
"kafkajs": "^2.2.4"
|
|
48
48
|
},
|
|
49
|
-
"packageManager": "pnpm@9
|
|
49
|
+
"packageManager": "pnpm@9"
|
|
50
50
|
}
|