@itentialopensource/adapter-kafkav2 0.6.0 → 0.6.2

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.6.2 [05-16-2023]
3
+
4
+ * added support for separate topics files per adapter
5
+
6
+ See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!5
7
+
8
+ ---
9
+
10
+ ## 0.6.1 [05-04-2023]
11
+
12
+ * added support for separate topics files per adapter
13
+
14
+ See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!5
15
+
16
+ ---
17
+
2
18
  ## 0.6.0 [04-10-2023]
3
19
 
4
20
  * Turn Off stream if WFE or OpMgr are down
package/README.md CHANGED
@@ -99,7 +99,7 @@ This section defines **all** the properties that are available for the adapter,
99
99
  "idleConnection": 300000,
100
100
  "reconnectOnIdle": true,
101
101
  "maxAsyncRequests": 10,
102
- "sslOptions": {},
102
+ "ssl": {},
103
103
  "sasl": {}
104
104
  },
105
105
  "producer": {
@@ -243,7 +243,7 @@ The following properties are used to define the Kafka Client. These properties a
243
243
  | idleConnection | ms before allowing the broker to disconnect an idle connection from a client. |
244
244
  | reconnectOnIdle | when the connection is closed due to client idling, client will attempt to auto-reconnect.|
245
245
  | maxAsyncRequests | maximum async operations at a time toward the kafka cluster..|
246
- | sslOptions | Object, options to be passed to the tls broker sockets, ex. { rejectUnauthorized: false }.|
246
+ | ssl | Object, options to be passed to the tls broker sockets, ex. { rejectUnauthorized: false }.|
247
247
  | sasl | Object, SASL authentication configuration (only SASL/PLAIN is currently supported), ex. { mechanism: 'plain', username: 'foo', password: 'bar' }.|
248
248
 
249
249
  ### Producer Properties
package/adapter.js CHANGED
@@ -178,11 +178,15 @@ class Kafkav2 extends AdapterBaseCl {
178
178
 
179
179
  // put topics from file into memory
180
180
  this.topicsEvents = [];
181
- const topicsFile = path.join(__dirname, '/.topics.json');
181
+ let topicsFile = path.join(__dirname, `/.topics-${this.id}.json`);
182
182
 
183
183
  // if the file does not exist - error
184
184
  if (fs.existsSync(topicsFile)) {
185
185
  this.topicsEvents = JSON.parse(fs.readFileSync(topicsFile, 'utf-8'));
186
+ } else if (fs.existsSync(path.join(__dirname, '/.topics.json'))) {
187
+ log.debug('Found old .topics.json file.');
188
+ topicsFile = path.join(__dirname, '/.topics.json');
189
+ this.topicsEvents = JSON.parse(fs.readFileSync(topicsFile, 'utf-8'));
186
190
  }
187
191
 
188
192
  // get the topics into the right format --- fix older .topics.json files so they have the right format
@@ -395,7 +399,8 @@ class Kafkav2 extends AdapterBaseCl {
395
399
  const intTime = this.props.interval_time || 30000;
396
400
  setInterval(() => {
397
401
  try {
398
- log.debug('Update .topics.json file');
402
+ const split = topicsFile.split('/');
403
+ log.debug(`Update ${split[split.length - 1]} file.`);
399
404
  fs.writeFileSync(topicsFile, JSON.stringify(this.topicsEvents, null, 2));
400
405
  } catch (err) {
401
406
  log.error(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-kafkav2",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Itential adapter to connect to kafka",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.35.0",
Binary file