@itentialopensource/adapter-kafkav2 0.3.14 → 0.3.15

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,12 @@
1
1
 
2
+ ## 0.3.15 [02-17-2023]
3
+
4
+ * Updated readme
5
+
6
+ See merge request itentialopensource/adapters/notification-messaging/adapter-kafkav2!2
7
+
8
+ ---
9
+
2
10
  ## 0.3.14 [02-16-2023]
3
11
 
4
12
  * updated to allow multiple subscribers per topic entry and fixed partition logic
package/README.md CHANGED
@@ -148,9 +148,66 @@ Example of adapter's configuration with filtering applied:
148
148
  }
149
149
  ],
150
150
  ```
151
-
152
151
  When operator skips to provide `filters` property or the property contains no actual filters set, then all messages are passed.
153
152
 
153
+ Example of adapter's configuration with multiple paritions and subscribers per topic:
154
+ ```json
155
+ "topics": [
156
+ {
157
+ "name": "topic1",
158
+ "always": true,
159
+ "partition": 0,
160
+ "subscriberInfo": [
161
+ {
162
+ "subname": "default",
163
+ "filters": [
164
+ "PIXI",
165
+ "DRED",
166
+ "F: (\\w+), L: (\\w+)",
167
+ "\\d{3,4}"
168
+ ],
169
+ "rabbit": "topic1",
170
+ "throttle": {}
171
+ },
172
+ {
173
+ "subname": "sub2",
174
+ "filters": [
175
+ "[abc]",
176
+ "F: (\\w+), L: (\\w+)",
177
+ "\\d{3,4}"
178
+ ],
179
+ "rabbit": "topic1-s2",
180
+ "throttle": {}
181
+ }
182
+ ]
183
+ },
184
+ {
185
+ "name": "topic1",
186
+ "always": true,
187
+ "partition": 1,
188
+ "subscriberInfo": [
189
+ {
190
+ "subname": "default",
191
+ "filters": [
192
+ "PIXI",
193
+ "DRED",
194
+ "[abc]",
195
+ "F: (\\w+), L: (\\w+)",
196
+ "\\d{3,4}"
197
+ ],
198
+ "rabbit": "topic1-p1",
199
+ "throttle": {}
200
+ }
201
+ ]
202
+ },
203
+ {
204
+ "name": "test-6",
205
+ "always": true
206
+ }
207
+ ],
208
+ ```
209
+ Note that if no parition is supplied only messages on partition 0 will be consumed. Additionally, if no rabbit topic is supplied, events will be published to a topic with the same name as the Kafka topic. For example, topic `test-6` above will be published to the `test-6` rabbit topic.
210
+
154
211
  ### Connection Properties
155
212
 
156
213
  These base properties are used to connect to Kafka upon the adapter initially coming up. It is important to set these properties appropriately.
@@ -211,6 +268,10 @@ The following properties are used to define the Kafka Consumer. These properties
211
268
  | encoding | If set to 'buffer', values will be returned as raw buffer objects..|
212
269
  | keyEncoding | |
213
270
 
271
+ ## Parsing Properties
272
+
273
+ The `parseMessage` property allows the user to define how they want the Kafka message to be published to IAP's event system. If `parseMessage` is set to true or omitted, the value of the Kafka message will be parsed as either an object or string and wrapped in an outer object. The wrapper object's key can be defined with the property `wrapMessage`, or the default value `payload` can be used if omitted. If `parseMessage` is set to false, the entire kafka payload, including metadata, would be returned and the message itself would need to be transformed at a later point.
274
+
214
275
  ## Testing an Itential Product Adapter
215
276
 
216
277
  Mocha is generally used to test all Itential Product Adapters. There are unit tests as well as integration tests performed. Integration tests can generally be run as standalone using mock data and running the adapter in stub mode, or as integrated. When running integrated, every effort is made to prevent environmental failures, however there is still a possibility.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-kafkav2",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
4
4
  "description": "Itential adapter to connect to kafka",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.35.0",
Binary file