prefetch (QoS) จำกัดจำนวน ข้อความที่ยังไม่ถูก acknowledge ที่ consumer สามารถถือไว้ได้ในเวลาเดียวกัน — ควบคุมการกระจายงานและป้องกันไม่ให้ consumer ตัวหนึ่งล้นมือขณะที่ตัวอื่นว่างอยู่ สิ่งนี้มีความสำคัญต่อการประมวลผลข้อความที่เป็นธรรมและมีประสิทธิภาพ
prefetch ทำอะไร
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
