@itentialopensource/adapter-kafkav2 0.3.17 → 0.4.0
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/CHANGELOG.md +8 -0
- package/adapter.js +15 -3
- package/package.json +1 -1
- package/pronghorn.json +3 -1
- package/refs?service=git-upload-pack +0 -0
package/CHANGELOG.md
CHANGED
package/adapter.js
CHANGED
|
@@ -251,7 +251,7 @@ class Kafkav2 extends EventEmitterCl {
|
|
|
251
251
|
pjson.topics[topName] = {};
|
|
252
252
|
needRestart = true;
|
|
253
253
|
}
|
|
254
|
-
const topPart = this.props.topics[t].partition || 0;
|
|
254
|
+
const topPart = this.props.topics[t].partitions || this.props.topics[t].partition || 0;
|
|
255
255
|
let useAvro = 'NO';
|
|
256
256
|
if (this.props.topics[t].avro !== undefined && this.props.topics[t].avro !== null && this.props.topics[t].avro === true) {
|
|
257
257
|
useAvro = 'YES';
|
|
@@ -277,7 +277,19 @@ class Kafkav2 extends EventEmitterCl {
|
|
|
277
277
|
let found = false;
|
|
278
278
|
for (let te = 0; te < this.topicsEvents.length; te += 1) {
|
|
279
279
|
// see if we find the topic and partition
|
|
280
|
-
|
|
280
|
+
let updatedPartitionArray = false;
|
|
281
|
+
if (Array.isArray(this.topicsEvents[te].partition)) {
|
|
282
|
+
if (Array.isArray(topPart)) {
|
|
283
|
+
this.topicsEvents[te].partition = topPart;
|
|
284
|
+
updatedPartitionArray = true;
|
|
285
|
+
} else if (this.topicsEvents[te].partition.includes(topPart)) {
|
|
286
|
+
updatedPartitionArray = true;
|
|
287
|
+
} else {
|
|
288
|
+
this.topicsEvents[te].partition.push(topPart);
|
|
289
|
+
updatedPartitionArray = true;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (this.topicsEvents[te].topic === topName && (updatedPartitionArray === true || this.topicsEvents[te].partition === topPart)) {
|
|
281
293
|
found = true;
|
|
282
294
|
// only set the rabbit in the topic if it is the default (kafka)
|
|
283
295
|
if (this.topicsEvents[te].subInfo.rabbit === 'kafka') {
|
|
@@ -493,7 +505,7 @@ class Kafkav2 extends EventEmitterCl {
|
|
|
493
505
|
}
|
|
494
506
|
// find the topic here to change the offset
|
|
495
507
|
for (let t = 0; t < this.topicsEvents.length; t += 1) {
|
|
496
|
-
if (this.topicsEvents[t].topic === topic && this.topicsEvents[t].partition === partition) {
|
|
508
|
+
if (this.topicsEvents[t].topic === topic && (this.topicsEvents[t].partition === partition || this.topicsEvents[t].partition.includes(partition))) {
|
|
497
509
|
allowedPartition = true;
|
|
498
510
|
if (this.topicsEvents[t].offset < message.offset) {
|
|
499
511
|
this.topicsEvents[t].offset = message.offset;
|
package/package.json
CHANGED
package/pronghorn.json
CHANGED
|
Binary file
|