Merge pull request #31583 from Jonas-Beck/docs/events
docs(events): add documentation for kafka events module
This commit is contained in:
@@ -141,7 +141,7 @@ events:
|
||||
region: us-east-2
|
||||
```
|
||||
|
||||
The [AWS SQS module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-aws-sqs/README.md#configuration) has more details on the configuration options, the example above includes on the required options.
|
||||
The [AWS SQS module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-aws-sqs/README.md#configuration) has more details on the configuration options, the example above includes only the required options.
|
||||
|
||||
### Events Setup using Google Pub/Sub module
|
||||
|
||||
@@ -179,7 +179,53 @@ events:
|
||||
targetTopic: 'github.{{ event.attributes.x-github-event }}'
|
||||
```
|
||||
|
||||
The [Google Pub/Sub module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-google-pubsub/README.md#configuration) has more details on the configuration options, the example above includes on the required options.
|
||||
The [Google Pub/Sub module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-google-pubsub/README.md#configuration) has more details on the configuration options, the example above includes only the required options.
|
||||
|
||||
### Events Setup using Kafka module
|
||||
|
||||
Alternatively to using the HTTP endpoint you can use the Kafka module, here's how.
|
||||
|
||||
First we need to add the package:
|
||||
|
||||
```bash title="from your Backstage root directory"
|
||||
yarn --cwd packages/backend add @backstage/plugin-events-backend-module-kafka
|
||||
```
|
||||
|
||||
Then we need to add it to your backend:
|
||||
|
||||
```ts title="in packages/backend/src/index.ts"
|
||||
backend.add(import('@backstage/plugin-events-backend'));
|
||||
backend.add(import('@backstage/plugin-events-backend-module-github'));
|
||||
/* highlight-add-start */
|
||||
backend.add(import('@backstage/plugin-events-backend-module-kafka'));
|
||||
/* highlight-add-end */
|
||||
```
|
||||
|
||||
Finally you will want to configure it:
|
||||
|
||||
```yaml title="app-config.yaml
|
||||
events:
|
||||
modules:
|
||||
kafka:
|
||||
kafkaConsumingEventPublisher:
|
||||
# Client ID used by Backstage to identify when connecting to the Kafka cluster.
|
||||
clientId: your-client-id
|
||||
# List of brokers in the Kafka cluster to connect to.
|
||||
brokers:
|
||||
- broker1
|
||||
- broker2
|
||||
topics:
|
||||
# Replace with actual topic name as expected by subscribers
|
||||
- topic: 'backstage.topic'
|
||||
kafka:
|
||||
# The Kafka topics to subscribe to.
|
||||
topics:
|
||||
- topic1
|
||||
# The GroupId to be used by the topic consumers.
|
||||
groupId: your-group-id
|
||||
```
|
||||
|
||||
The [Kafka module `README`](https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-kafka/README.md#configuration) has more details on the configuration options, the example above includes only the required options.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -132,6 +132,8 @@ You can decide between the following options (extensible):
|
||||
|
||||
- [via HTTP endpoint](https://github.com/backstage/backstage/tree/master/plugins/events-backend/README.md)
|
||||
- [via an AWS SQS queue](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-aws-sqs/README.md)
|
||||
- [via Google Pub/Sub](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-google-pubsub/README.md)
|
||||
- [via a Kafka topic](https://github.com/backstage/backstage/tree/master/plugins/events-backend-module-kafka/README.md)
|
||||
|
||||
You can check the official docs to [configure your webhook](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks) and to [secure your request](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks).
|
||||
The webhook will need to be configured to forward `organization`,`team` and `membership` events.
|
||||
|
||||
Reference in New Issue
Block a user