@itentialopensource/adapter-kafkav2 0.6.10 → 0.8.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 +16 -0
- package/adapter.js +10 -1
- package/package.json +1 -1
- package/refs?service=git-upload-pack +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## 0.8.0 [05-25-2023]
|
|
3
|
+
|
|
4
|
+
* Add topic name to message
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!6
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0.7.0 [05-19-2023]
|
|
11
|
+
|
|
12
|
+
* Add topic name to message
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!6
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
2
18
|
## 0.6.10 [05-19-2023]
|
|
3
19
|
|
|
4
20
|
* Bug fixes and performance improvements
|
package/adapter.js
CHANGED
|
@@ -423,6 +423,14 @@ class Kafkav2 extends AdapterBaseCl {
|
|
|
423
423
|
this.emit('OFFLINE', { id: this.id });
|
|
424
424
|
this.alive = true;
|
|
425
425
|
|
|
426
|
+
if (this.props && this.props.stub === true) {
|
|
427
|
+
this.emit('ONLINE', {
|
|
428
|
+
id: this.id
|
|
429
|
+
});
|
|
430
|
+
log.info('EMITTED ONLINE ON STUB MODE');
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
|
|
426
434
|
try {
|
|
427
435
|
// Create a kafka client
|
|
428
436
|
const combinedProps = this.props.client || {};
|
|
@@ -507,7 +515,6 @@ class Kafkav2 extends AdapterBaseCl {
|
|
|
507
515
|
eachMessage: async ({ topic, partition, message }) => {
|
|
508
516
|
log.info(`PROCESSING NEW MESSAGE ON TOPIC: ${topic} PARTITION: ${partition} WITH OFFSET: ${message.offset}`);
|
|
509
517
|
const newMsg = message;
|
|
510
|
-
newMsg.topic = topic;
|
|
511
518
|
let avroUsed = false;
|
|
512
519
|
let desiredTopic = [];
|
|
513
520
|
let allowedPartition = false;
|
|
@@ -588,10 +595,12 @@ class Kafkav2 extends AdapterBaseCl {
|
|
|
588
595
|
messageObj = { [wrapper]: newMsg.value.toString() };
|
|
589
596
|
}
|
|
590
597
|
for (let j = 0; j < desiredTopic.length; j += 1) {
|
|
598
|
+
messageObj.topic = topic;
|
|
591
599
|
eventSystem.publish(desiredTopic[j], messageObj);
|
|
592
600
|
}
|
|
593
601
|
} else {
|
|
594
602
|
for (let j = 0; j < desiredTopic.length; j += 1) {
|
|
603
|
+
newMsg.topic = topic;
|
|
595
604
|
eventSystem.publish(desiredTopic[j], newMsg);
|
|
596
605
|
}
|
|
597
606
|
}
|
package/package.json
CHANGED
|
Binary file
|