Acknowledgment (ack) memberitahu RabbitMQ bahawa sesuatu mesej telah berjaya diproses, supaya ia boleh dibuang daripada queue. Ia penting untuk penghantaran yang boleh dipercayai — memastikan mesej tidak hilang jika consumer gagal.
Bagaimana acknowledgment berfungsi
When a consumer receives and processes a message, it ACKNOWLEDGES it:
→ ACK → "I've processed this message" → RabbitMQ removes it from the queue
→ if a consumer DIES before acking (crash, disconnect) → RabbitMQ REQUEUES the message
→ redelivered to another consumer (NOT lost)
→ acks ensure messages are processed reliably (not lost if a consumer fails)
