My Order
aggregate root is able to emit several Event
, e.g. OrderCreated
, OrderPaid
, OrderCancelled
. Would it be good design to store all types of order event into single kafka topic and to have the orderId
as the message key, as suggested here? Or Should I create sepparate topic for each of them?
The pro of having single topic is that the order of events is maintained, but consumer would need to filter some events on their end. The pro of second approach is consumer would be simpler as they can subscribe to the exact topic that they need, but constructing Order
requires subscribing to multiple topic while they don't come from kafka in the right sequence as they are from different topics.
Thank you