kafka-ts 0.0.8 → 0.0.13
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/dist/api/sync-group.js
CHANGED
|
@@ -43,6 +43,9 @@ const encodeAssignment = (data) => new encoder_1.Encoder()
|
|
|
43
43
|
.value();
|
|
44
44
|
const decodeAssignment = (data) => {
|
|
45
45
|
const decoder = new decoder_1.Decoder(data);
|
|
46
|
+
if (!decoder.getBufferLength()) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
46
49
|
const result = {
|
|
47
50
|
version: decoder.readInt16(),
|
|
48
51
|
assignment: decoder.readArray((decoder) => ({
|
|
@@ -106,7 +106,7 @@ class Consumer extends events_1.default {
|
|
|
106
106
|
await this.cluster.disconnect().catch((error) => logger_1.log.debug(`Failed to disconnect: ${error.message}`));
|
|
107
107
|
}
|
|
108
108
|
async startFetchManager() {
|
|
109
|
-
const { batchGranularity, concurrency } = this.options;
|
|
109
|
+
const { groupId, batchGranularity, concurrency } = this.options;
|
|
110
110
|
while (!this.stopHook) {
|
|
111
111
|
await this.consumerGroup?.join();
|
|
112
112
|
// TODO: If leader is not available, find another read replica
|
|
@@ -131,7 +131,7 @@ class Consumer extends events_1.default {
|
|
|
131
131
|
try {
|
|
132
132
|
await this.fetchManager.start();
|
|
133
133
|
if (!nodeAssignments.length) {
|
|
134
|
-
logger_1.log.debug('No partitions assigned. Waiting for reassignment...');
|
|
134
|
+
logger_1.log.debug('No partitions assigned. Waiting for reassignment...', { groupId });
|
|
135
135
|
await (0, delay_1.delay)(this.options.maxWaitMs);
|
|
136
136
|
this.consumerGroup?.handleLastHeartbeat();
|
|
137
137
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kafka-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"author": "Priit Käärd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"up": "npm run down && KAFKA_VERSION=3.7.1 docker-compose up -d && sleep 5 && bash ./scripts/create-scram-user.sh",
|
|
13
13
|
"down": "KAFKA_VERSION=3.7.1 docker-compose down",
|
|
14
|
-
"version:prerelease": "npm version prerelease",
|
|
14
|
+
"version:prerelease": "npm version prerelease --preid=beta",
|
|
15
15
|
"version:patch": "npm version patch",
|
|
16
16
|
"format": "prettier --write .",
|
|
17
17
|
"build": "tsc",
|