@itentialopensource/adapter-kafkav2 0.13.0 → 0.14.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 +34 -1
- package/package.json +1 -1
- package/refs?service=git-upload-pack +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
## 0.14.0 [08-04-2023]
|
|
3
|
+
|
|
4
|
+
* Add logic to clean topics.json from service config
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!11
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
2
10
|
## 0.13.0 [08-03-2023]
|
|
3
11
|
|
|
4
12
|
* Add seperate sasl props for consumer and producer
|
package/adapter.js
CHANGED
|
@@ -349,12 +349,45 @@ class Kafkav2 extends AdapterBaseCl {
|
|
|
349
349
|
processed: 0,
|
|
350
350
|
subscribers: 99999,
|
|
351
351
|
avro: useAvro,
|
|
352
|
-
subInfo
|
|
352
|
+
subInfo,
|
|
353
|
+
source: 'props'
|
|
353
354
|
});
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
358
|
|
|
359
|
+
// check if service config doesnt have a topic and the source was props, delete it from topics
|
|
360
|
+
for (let te = 0; te < this.topicsEvents.length; te += 1) {
|
|
361
|
+
let topicFound = false;
|
|
362
|
+
for (let t = 0; t < this.props.topics.length; t += 1) {
|
|
363
|
+
if (this.topicsEvents[te].topic === this.props.topics[t].name && this.topicsEvents[te].source) {
|
|
364
|
+
if (this.topicsEvents[te].subInfo) {
|
|
365
|
+
const { subInfo } = this.topicsEvents[te];
|
|
366
|
+
for (let sub = 0; sub < subInfo.length; sub += 1) {
|
|
367
|
+
let subFound = false;
|
|
368
|
+
for (let s = 0; s < this.props.topics[t].subscriberInfo.length; s += 1) {
|
|
369
|
+
// if the subscriber is found, no need to add anything
|
|
370
|
+
if (subInfo[sub].subname === this.props.topics[t].subscriberInfo[s].subname) {
|
|
371
|
+
subFound = true;
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (subFound === false) {
|
|
376
|
+
this.topicsEvents[te].subInfo.splice(sub, 1);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
topicFound = true;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (topicFound === false && this.topicsEvents[te].source === 'props') {
|
|
384
|
+
this.topicsEvents.splice(te, 1);
|
|
385
|
+
const split = topicsFile.split('/');
|
|
386
|
+
log.debug(`Update ${split[split.length - 1]} file.`);
|
|
387
|
+
fs.writeFileSync(topicsFile, JSON.stringify(this.topicsEvents, null, 2));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
358
391
|
// if we need to restart the adapter due to changes to pronghorn.json
|
|
359
392
|
if (needRestart) {
|
|
360
393
|
fs.writeFileSync(pronghornFile, JSON.stringify(pjson, null, 2));
|
package/package.json
CHANGED
|
Binary file
|