@itentialopensource/adapter-kafkav2 0.3.16 → 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 CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 0.4.0 [02-28-2023]
3
+
4
+ * minor/adapt-2595
5
+
6
+ See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!3
7
+
8
+ ---
9
+
10
+ ## 0.3.17 [02-20-2023]
11
+
12
+ * Updated readme
13
+
14
+ See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!2
15
+
16
+ ---
17
+
2
18
  ## 0.3.16 [02-20-2023]
3
19
 
4
20
  * Updated readme
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
- if (this.topicsEvents[te].topic === topName && this.topicsEvents[te].partition === topPart) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-kafkav2",
3
- "version": "0.3.16",
3
+ "version": "0.4.0",
4
4
  "description": "Itential adapter to connect to kafka",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.35.0",
package/pronghorn.json CHANGED
@@ -9,7 +9,9 @@
9
9
  "admin"
10
10
  ],
11
11
  "topics": {
12
- "kafka": {}
12
+ "kafka": {},
13
+ "test-topic": {},
14
+ "test_topic": {}
13
15
  },
14
16
  "methods": [
15
17
  {
Binary file
@@ -13,24 +13,14 @@
13
13
  "brokers": [
14
14
  "localhost:9092"
15
15
  ],
16
- "sslOptions": {},
16
+ "ssl": {},
17
17
  "sasl": {}
18
18
  },
19
19
  "producer": {
20
- "requireAcks": 1,
21
- "ackTimeoutMs": 100,
22
- "partitionerType": 0
20
+ "allowAutoTopicCreation": true
23
21
  },
24
22
  "consumer": {
25
- "groupId": "kafka-node-group",
26
- "autoCommit": false,
27
- "autoCommitIntervalMs": 5000,
28
- "fetchMaxWaitMs": 100,
29
- "fetchMinBytes": 1,
30
- "fetchMaxBytes": 1048576,
31
- "fromOffset": true,
32
- "encoding": "utf8",
33
- "keyEncoding": "utf8"
23
+ "groupId": "kafka-node-group"
34
24
  }
35
25
  },
36
26
  "logLevel": "none",