My Order aggregated root is capable of emitting multiple Event , for example. OrderCreated , OrderPaid , OrderCancelled . Will a good design store all types of order events in one kafka theme and have orderId as the message key, as suggested here ? Or should I create a separate topic for each of them?
About the whole topic is that the order of events is supported, but the consumer will need to filter some events at their end. The second approach is the consumer, which will be simpler, because they can subscribe to the exact topic that they need, but to build an Order need to subscribe to several topics, while they do not come from kafka in the correct sequence, since they are from different topics.
thanks
domain-driven-design apache-kafka event-sourcing
Fajarmf
source share