Prefetch (QoS) mengehadkan berapa banyak mesej yang belum diakui (unacknowledged) yang boleh dipegang oleh consumer pada satu masa — mengawal pengagihan kerja dan menghalang satu consumer daripada dibebani manakala yang lain terbiar. Ia penting untuk pemprosesan mesej yang adil dan cekap.
Apa yang prefetch lakukan
PREFETCH (QoS - prefetch count) → limits the number of UNACKNOWLEDGED messages a consumer
can have at once:
→ without it → RabbitMQ may dispatch many messages to one consumer (it grabs a batch)
→ with prefetch=N → a consumer gets at most N unacked messages at a time (must ack to get more)
→ controls how messages are distributed and how much a consumer buffers
