Event enrichment combines related events to produce a more complete representation of a business object or occurrence. A common pattern joins an order with its corresponding payment using order.id = payment.order_id, then emits an aggregated object. section 8.3.6
Reliable enrichment depends on two architectural conditions:
- Joined topics must have the same partition count, key distribution strategy, and partitioning logic. section 8.3.6
- Records with the same join key must reach corresponding partitions so Kafka Streams assigns them to the same task. section 8.3.6
- Applications must handle events arriving at different times and in either order. section 8.3.6
Figure 8.13 Partitions with the same index are assigned to the same task, and this assignment remains fixed. Elements in input topics that arrive in partitions with the same index will be processed together.
Partition diagrams show why matching partition indexes let related records be processed together. section 8.3.6
