Skip to content

Commit b82d9e1

Browse files
more review comments
1 parent ef0cada commit b82d9e1

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

content/en/docs/refguide/modeling/integration/change-data-capture/_index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ When connecting to a BYOK Kafka cluster, provide the bootstrap server address an
6969
| `EventBroker.CdcProducerTransactionId` | The transactional ID for the Kafka CDC producer, enabling exactly-once delivery semantics. Must be set together with `EventBroker.CdcActiveProducerElectionTopic` and `EventBroker.CdcActiveProducerElectionGroupId` to enable active-producer election mode. | | |
7070

7171

72+
### Active-Producer Election {#active-producer-election}
73+
74+
In a horizontally scaled deployment, multiple app instances would otherwise all publish CDC events to the same Kafka topics, producing duplicates. Active-producer election ensures that only one instance publishes at a time.
75+
76+
When all three election settings are configured, each instance joins the same Kafka consumer group and subscribes to the election topic. Kafka assigns partition 0 of that topic to exactly one member of the group — that instance becomes the active producer. All other instances stand by without publishing.
77+
78+
If the active instance stops sending heartbeats (for example, because it crashed or was scaled down), Kafka triggers a rebalance and assigns the partition to another instance, which then starts producing. The departing instance drains any in-flight events before relinquishing the partition to prevent gaps.
79+
80+
The `EventBroker.CdcProducerTransactionId` setting enables Kafka transactions on the active producer, which provides exactly-once delivery guarantees during normal operation and clean handover during failover.
81+
82+
If any of the three settings is missing, the runtime logs a warning and falls back to single-instance mode, where all instances publish independently.
83+
84+
### Message Format {#message-format}
85+
86+
CDC events follow the [Debezium](https://debezium.io/) envelope format. Each message contains an `op` field indicating the operation type (`c` for create, `u` for update, `d` for delete, `r` for read/snapshot), a `before` and `after` payload with the entity attribute values, and a `source` block with metadata such as the timestamp and Mendix version.
87+
88+
Because the format is Debezium-compatible, BYOK consumers that already support Debezium — such as Kafka Connect sink connectors for databases or data warehouses — can consume CDC events without any message transformation.
89+
90+
To parse the messages, the schema for each tracked entity is available as an AsyncAPI document. You can download it from the [Event Broker Manager](https://broker.mendix.com/) on the service details page for the CDC service.
91+
7292
For details on setting up a BYOK cluster with the Mendix Event Broker, see [Mendix Event Broker](/appstore/services/event-broker/).
7393

7494
## Read More

content/en/docs/refguide/modeling/integration/change-data-capture/published-cdc-services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Each row in the table has the following columns:
4949
| **Exposed name** | The name used for this entity in the Kafka topic and event payload. Defaults to the entity name. |
5050
| **Modification** | The pending change state: **Added**, **Changed**, or **Removed**. Blank if the entity is unchanged since the last accepted revision. |
5151
| **Revision** | The schema version of the entity's event payload. See [Revisions](#revisions). |
52-
| **Topic** | The Kafka topic name for this entity, in the format `cdc.<app-name>.<ExposedName>.<revision>.{space}`, where `{space}` is replaced at runtime by the Event Broker space name. |
52+
| **Topic** | The Kafka topic name for this entity, in the format `cdc.<app-name>.<ExposedName>.<revision>.{space}`, where `{space}` is replaced at runtime by the Event Broker space name. See [Bring Your Own Kafka (BYOK)](/refguide/change-data-capture/#byok-configuration) |
5353

5454
### Adding an Entity {#add-entity}
5555

0 commit comments

Comments
 (0)