Elffuss BraidHub

kikocis/EDC public

main · 3.8 KiBRenderedRawPermalink
1# Data Plane Kafka extension
2
3## Background
4
5### Scope
6
7This extension provides support for consuming from and publishing to a Kafka broker.
8
9### Limitations
10
11> ⚠️ **This code is not intended for production-grade streaming pipelines!**
12
13Even if it provides capabilities to stream events from an event source to a destination, this implementation drops
14most of the inherent guarantees and benefits of a streaming pipeline, i.e. asynchronicity, ordering, resilience, delivery guarantee...
15Depending on the protocol chosen to push the events to the consumer (e.g. http), it might also come with poor performances.
16
17It also puts the pressure on the provider Data Plane which must operate the consuming threads (see `KafkaDataSource`) that
18are constantly polling for events on the source topic. One thread being created for each transfer, it means that the number of threads
19allocated by the provider Data Plane for fetching the events will linearly increase with the number of consumers, which might become
20a limiting factor at some point.
21
22Finally, the sink (see `HttpDataSink`) is publishing events asynchronously and in parallel, which means that there is no guarantee
23on the final order in which events are delivered.
24
25### Use Cases
26
27Streaming events from the provider Kafka broker and pushing them to the consumer (potentially with a different protocol, such as http, websocket...).
28
29## Technical Details
30
31### `KafkaDataSource`
32
33#### Data Address
34
35This `DataSource` implementation is triggered when the type of the source address is set to `Kafka` (case-insensitive).
36Parameters are listed below:
37
38| Parameter | Description | Mandatory | Default value |
39|:-------------|:---------------------------------------------------------------------------------------|:--------------------------------------------|:------------------------------------|
40| topic | Broker topic from which events are consumed | true | |
41| kafka.* | Kafka consumer properties | Only `kafka.bootstrap.servers` is mandatory | |
42| name | Name of the transfer | false | `null` |
43| maxDuration | Duration of the stream, specified as ISO-8601 duration e.g. "PT10S" for 10 seconds | false | If not specified, stream never ends |
44| pollDuration | Duration between two polls, specified as ISO-8601 duration e.g. "PT10S" for 10 seconds | false | 1 second |
45
46#### Consumer group
47
48The consumer group is automatically determined from the request as followed:
49
50```
51<CONSUMER_GROUP>=<PROCESS_ID>:<REQUEST_ID>
52```
53
54### `KafkaDataSink`
55
56#### Data address
57
58This `DataSink` implementation is triggered when the type of the source address is set to `Kafka` (case-insensitive).
59Parameters are listed below:
60
61| Parameter | Description | Mandatory | Default value |
62|:----------|:--------------------------------------------|:--------------------------------------------|:--------------|
63| topic | Broker topic from which events are consumed | true | |
64| kafka.* | Kafka producer properties | Only `kafka.bootstrap.servers` is mandatory | |
65
66#### Event publishing
67
68Events are published in parallel and asynchronously (non-blocking). There is no retry-on-error nor guarantee on the order
69in which events are published.