For now, the broker is in charge of data ordering. The broker seeks published data and makes the correct order, and send it to consumers.
But this design incurs lots of seeking. Furthermore, since UDP does not guarantee the packet order, it only suits TCP.
The main actor of data ordering should be the consumer. To implement this, before pushing data to the consumer's subscribing channel, a small buffer to temporarily storing data is needed. If the offset of data is in order then data have to be pushed to subscribing channel.
For now, the broker is in charge of data ordering. The broker seeks published data and makes the correct order, and send it to consumers. But this design incurs lots of seeking. Furthermore, since UDP does not guarantee the packet order, it only suits TCP. The main actor of data ordering should be the consumer. To implement this, before pushing data to the consumer's subscribing channel, a small buffer to temporarily storing data is needed. If the offset of data is in order then data have to be pushed to subscribing channel.