I understand that 2 options are available:
But what does this actually mean?
"Non-persistent" as in : the AMQP fabric will try to deliver the message if there are no consumers, the message will be dropped?
"Persistent" as in : AMQP will retry the message until a consumer accepts it??
When a consumer (subscription) is registered, messages will be delivered (pushed) by RabbitMQ using the basic. deliver method. The method carries a delivery tag, which uniquely identifies the delivery on a channel. Delivery tags are therefore scoped per channel.
AMQP allows for various guaranteed messaging modes specifying a message be sent: At-most-once(sent one time with the possibility of being missed). At-least-once (guaranteeing delivery with the possibility of duplicated messages). Exactly-once (guaranteeing a one-time only delivery).
For a queue to receive messages, it must be bound to at least one exchange. AMQP 0.9. 1 brokers should provide four exchange types - direct exchange, fanout exchange, topic exchange, and header exchange.
Messages marked as 'persistent' that are delivered to 'durable' queues will be logged to disk. Durable queues are recovered in the event of a crash, along with any persistent messages they stored prior to the crash.
delivery_mode
in AMQP determines if message will be stored on disk after broker restarts. You can mark messages as persistent - by seting delivery_mode property = 2
when you publish message for instance in PHP (PECL AMQP extension):
$exchange->publish($text, $routingKey, null, array('delivery_mode' => 2));
You would also need to declare queue as durable (or it will be dropped after broker stops)
$queue->setFlags(AMQP_DURABLE);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With