Sobes.tech
Middle+

Is there message prioritization in Kafka?

sobes.tech AI

Answer from AI

Apache Kafka does not have built-in message prioritization at the broker level. Messages in topics are ordered by partitions and offsets and are consumed in the order they are written. To implement prioritization, separate topics for different priorities are usually used, and they are processed in the desired order on the consumer side.

Example approach:

  • Create topics: high_priority, normal_priority, low_priority.
  • The consumer first reads from high_priority, then from normal_priority, and so on.

Thus, prioritization is achieved architecturally and is not built into Kafka itself.