Replies: 1 comment
-
Hey, If you have multiple publishers appending the records to the same streams->topics->partitions, of course, without any additional synchronization mechanism between them, you can't guarantee the proper ordering - the only thing that you can do, is to provide the custom message key (e.g. |
Beta Was this translation helpful? Give feedback.
-
Ordering Assurance
Messages from a single publisher are delivered in the order they’re created to the subscriber. For multiple publishers, messages are out of order for different subscribers, and there’s no guarantee that messages will be delivered in the order they were published.
While out-of-order message delivery can be limiting in some use cases that require strict message ordering, it offers high performance and scalability benefits. For instance, you need message ordering to build control systems in a factory setting, but whether temperature readings from different sensors are delivered in a particular order is less critical.
For temperature, you need the latest measurement to be delivered on time, but it’s not important that an old reading is received last. By including timestamps in the message so that older timestamps can just be discarded, you can mitigate the ordering challenge in cases where it isn’t needed.
2.Kafka
Kafka is highly recommended for applications where maintaining order is a critical requirement, for example, in log aggregation, complex event processing (CEP), and staged event-driven architecture (SEDA).
In these use cases, Kafka provides an ordering guarantee for messages within a partition, ensuring that messages are delivered to consumers in the same order as they were produced. This is achieved by maintaining an ordered sequence of records within a partition, ensuring the exact order of messages is preserved.
Beta Was this translation helpful? Give feedback.
All reactions