@backstage/plugin-events-backend-module-kafka 0.1.6-next.1 → 0.2.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +67 -25
  3. package/config.d.ts +504 -136
  4. package/dist/KafkaConsumingEventPublisher/KafkaConsumingEventPublisher.cjs.js +67 -0
  5. package/dist/KafkaConsumingEventPublisher/KafkaConsumingEventPublisher.cjs.js.map +1 -0
  6. package/dist/KafkaConsumingEventPublisher/config.cjs.js +71 -0
  7. package/dist/KafkaConsumingEventPublisher/config.cjs.js.map +1 -0
  8. package/dist/{service/eventsModuleKafkaConsumingEventPublisher.cjs.js → KafkaConsumingEventPublisher/module.cjs.js} +10 -9
  9. package/dist/KafkaConsumingEventPublisher/module.cjs.js.map +1 -0
  10. package/dist/KafkaPublishingEventConsumer/KafkaPublishingEventConsumer.cjs.js +73 -0
  11. package/dist/KafkaPublishingEventConsumer/KafkaPublishingEventConsumer.cjs.js.map +1 -0
  12. package/dist/KafkaPublishingEventConsumer/config.cjs.js +44 -0
  13. package/dist/KafkaPublishingEventConsumer/config.cjs.js.map +1 -0
  14. package/dist/KafkaPublishingEventConsumer/module.cjs.js +36 -0
  15. package/dist/KafkaPublishingEventConsumer/module.cjs.js.map +1 -0
  16. package/dist/index.cjs.js +10 -3
  17. package/dist/index.cjs.js.map +1 -1
  18. package/dist/index.d.ts +7 -4
  19. package/dist/utils/LoggerServiceAdapter.cjs.js.map +1 -0
  20. package/dist/utils/config.cjs.js +46 -0
  21. package/dist/utils/config.cjs.js.map +1 -0
  22. package/dist/utils/kafkaTransformers.cjs.js +24 -0
  23. package/dist/utils/kafkaTransformers.cjs.js.map +1 -0
  24. package/package.json +8 -8
  25. package/dist/publisher/KafkaConsumerClient.cjs.js +0 -44
  26. package/dist/publisher/KafkaConsumerClient.cjs.js.map +0 -1
  27. package/dist/publisher/KafkaConsumingEventPublisher.cjs.js +0 -63
  28. package/dist/publisher/KafkaConsumingEventPublisher.cjs.js.map +0 -1
  29. package/dist/publisher/LoggerServiceAdapter.cjs.js.map +0 -1
  30. package/dist/publisher/config.cjs.js +0 -102
  31. package/dist/publisher/config.cjs.js.map +0 -1
  32. package/dist/service/eventsModuleKafkaConsumingEventPublisher.cjs.js.map +0 -1
  33. /package/dist/{publisher → utils}/LoggerServiceAdapter.cjs.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @backstage/plugin-events-backend-module-kafka
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2c74ea9: Added support for multiple named instances in `kafkaConsumingEventPublisher` configuration. The previous single configuration format is still supported for backward compatibility.
8
+ - 2c74ea9: Added `KafkaPublishingEventConsumer` to support sending Backstage events to Kafka topics.
9
+
10
+ This addition enables Backstage to publish events to external Kafka systems, complementing the existing ability to receive events from Kafka. This allows for better integration with external systems that rely on Kafka for event streaming.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @backstage/plugin-events-node@0.4.18
16
+ - @backstage/backend-plugin-api@1.6.0
17
+
3
18
  ## 0.1.6-next.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -2,65 +2,107 @@
2
2
 
3
3
  Welcome to the `events-backend-module-kafka` backend module!
4
4
 
5
- This package is a module for the `events-backend` backend plugin and extends the events system with an `KafkaConsumingEventPublisher.`
5
+ This package is a module for the `events-backend` backend plugin and extends the events system with a `KafkaConsumingEventPublisher` and `KafkaPublishingEventConsumer`
6
6
 
7
- This event publisher will allow you to receive events from an Kafka queue and will publish these to the used `EventsService` implementation.
7
+ This module provides two-way integration with Kafka:
8
+
9
+ - **KafkaConsumingEventPublisher**: Receives events from Kafka queues and publishes them to the Backstage events system
10
+ - **KafkaPublishingEventConsumer**: Consumes events from Backstage and publishes them to Kafka queues
8
11
 
9
12
  ## Configuration
10
13
 
11
- To set up Kafka queues, you need to configure the following values:
14
+ To set up Kafka integration, you need to configure one or both of the following components:
15
+
16
+ ### KafkaConsumingEventPublisher Configuration
17
+
18
+ To receive events from Kafka queues and publish them to Backstage:
12
19
 
13
20
  ```yaml
14
21
  events:
15
22
  modules:
16
23
  kafka:
17
24
  kafkaConsumingEventPublisher:
18
- clientId: your-client-id # (Required) Client ID used by Backstage to identify when connecting to the Kafka cluster.
19
- brokers: # (Required) List of brokers in the Kafka cluster to connect to.
20
- - broker1
21
- - broker2
22
- topics:
23
- - topic: 'backstage.topic' # (Required) Replace with actual topic name as expected by subscribers
24
- kafka:
25
- topics: # (Required) The Kafka topics to subscribe to.
26
- - topic1
27
- groupId: your-group-id # (Required) The GroupId to be used by the topic consumers.
25
+ production: # Instance name, will be included in logs
26
+ clientId: your-client-id # (Required) Client ID used by Backstage to identify when connecting to the Kafka cluster.
27
+ brokers: # (Required) List of brokers in the Kafka cluster to connect to.
28
+ - broker1
29
+ - broker2
30
+ topics:
31
+ - topic: 'backstage.topic' # (Required) Replace with actual topic name as expected by subscribers
32
+ kafka:
33
+ topics: # (Required) The Kafka topics to subscribe to.
34
+ - topic1
35
+ groupId: your-group-id # (Required) The GroupId to be used by the topic consumers.
36
+ ```
37
+
38
+ ### KafkaPublishingEventConsumer Configuration
39
+
40
+ To publish events from Backstage to Kafka queues, you can configure the `KafkaPublishingEventConsumer`:
41
+
42
+ ```yaml
43
+ events:
44
+ modules:
45
+ kafka:
46
+ kafkaPublishingEventConsumer:
47
+ production: # Instance name, will be included in logs
48
+ clientId: your-client-id # (Required) Client ID used by Backstage to identify when connecting to the Kafka cluster.
49
+ brokers: # (Required) List of brokers in the Kafka cluster to connect to.
50
+ - broker1
51
+ - broker2
52
+ topics:
53
+ - topic: 'catalog.entity.created' # (Required) The Backstage topic to consume from
54
+ kafka:
55
+ topic: kafka-topic-name # (Required) The Kafka topic to publish to
28
56
  ```
29
57
 
30
58
  For a complete list of all available fields that can be configured, refer to the [config.d.ts file](./config.d.ts).
31
59
 
32
60
  ### Optional SSL Configuration
33
61
 
34
- If your Kafka cluster requires SSL, you can configure it as follows:
62
+ If your Kafka cluster requires SSL, you can configure it for both `kafkaConsumingEventPublisher` and `kafkaPublishingEventConsumer` instances:
35
63
 
36
64
  ```yaml
37
65
  events:
38
66
  modules:
39
67
  kafka:
40
68
  kafkaConsumingEventPublisher:
41
- ssl:
42
- rejectUnauthorized: true # (Optional) If true, the server certificate is verified against the list of supplied CAs.
43
- ca: [path/to/ca-cert] # (Optional) Array of trusted certificates in PEM format.
44
- key: path/to/client-key # (Optional) Private key in PEM format.
45
- cert: path/to/client-cert # (Optional) Public x509 certificate in PEM format.
69
+ production:
70
+ # ... other configuration ...
71
+ ssl:
72
+ rejectUnauthorized: true # (Optional) If true, the server certificate is verified against the list of supplied CAs.
73
+ ca: [path/to/ca-cert] # (Optional) Array of trusted certificates in PEM format.
74
+ key: path/to/client-key # (Optional) Private key in PEM format.
75
+ cert: path/to/client-cert # (Optional) Public x509 certificate in PEM format.
76
+ kafkaPublishingEventConsumer:
77
+ production:
78
+ # ... other configuration ...
79
+ ssl:
80
+ # Same SSL configuration options as above
46
81
  ```
47
82
 
48
83
  ### Optional SASL Authentication Configuration
49
84
 
50
- If your Kafka cluster requires `SASL` authentication, you can configure it as follows:
85
+ If your Kafka cluster requires SASL authentication, you can configure it for both components:
51
86
 
52
87
  ```yaml
53
88
  events:
54
89
  modules:
55
90
  kafka:
56
91
  kafkaConsumingEventPublisher:
57
- sasl:
58
- mechanism: 'plain' # SASL mechanism ('plain', 'scram-sha-256' or 'scram-sha-512')
59
- username: your-username # SASL username
60
- password: your-password # SASL password
92
+ production:
93
+ # ... other configuration ...
94
+ sasl:
95
+ mechanism: 'plain' # SASL mechanism ('plain', 'scram-sha-256' or 'scram-sha-512')
96
+ username: your-username # SASL username
97
+ password: your-password # SASL password
98
+ kafkaPublishingEventConsumer:
99
+ production:
100
+ # ... other configuration ...
101
+ sasl:
102
+ # Same SASL configuration options as above
61
103
  ```
62
104
 
63
- This section includes optional `SSL` and `SASL` authentication configuration for enhanced security.
105
+ These SSL and SASL configurations apply to both Kafka components and provide enhanced security for your Kafka connections.
64
106
 
65
107
  ## Installation
66
108