Publisher confirms ایک میکانزم ہے جہاں RabbitMQ پروڈیوسر کو تسلیم کرتا ہے کہ اس نے ایک پیغام حاصل کیا ہے (اور محفوظ کیا ہے) — یہ یقینی بناتا ہے کہ پیغامات پبلشنگ کے حق سے ضائع نہ ہوں۔ یہ کنزیومر acknowledgments کے لیے پروڈیوسر کے حق کا ہم منصب ہیں۔
مسئلہ: کیا پیغام broker تک پہنچا؟
When a producer publishes a message, by default it doesn't KNOW if RabbitMQ received it:
→ network failure, broker issue → the message could be LOST without the producer knowing
→ for reliability, the producer needs CONFIRMATION that the message was accepted
→ publisher confirms address the PUBLISHING side of reliability
Publisher confirms کیسے کام کرتے ہیں
PUBLISHER CONFIRMS → the broker sends an ACK back to the producer for each message:
→ enable confirm mode on the channel
→ the broker ACKs a message once it has taken responsibility (received it; for persistent
messages on durable queues → once persisted to disk)
→ NACK → the broker couldn't handle the message (the producer can retry)
→ the producer KNOWS each message was accepted (or not) → no silent loss
