This plugin persists or non-persists messages by filling the delivery_mode
property of a
message as it enters RabbitMQ with the AMQP 0-9-1 protocol defined setting of
2
or 1
, as the configured delivery_mode
value, regardless of the what value was
set/defined by the publishing client application. If enabled, it allows all RabbitMQ
ingress messages to be marked as persistent or transient on publish entry.
NOTE: The plugin assumes queues to which messages are destined to were
declared as durable, along with durable exchanges if full message
persistence is the desired outcome if delivery_mode is configured for persistence,
i.e. delivery_mode
= 2.
This plugin targets RabbitMQ 3.6.0 and later versions.
Fig 1 illustrates the overview operation of the rabbitmq-message-persister
plugin when in use within an active RabbitMQ instance.
Fig 1: RabbitMQ Message Persister Overview
On reception of the basic.publish
AMQP primitive, the rabbitmq-message-persister
channel interceptor is executed, applying the necessary/specific message persisting
primitives to the published content, prior handing it forward for further internal
processing. Message persisting primitives are always applied regardless of the previously
set message persisting fields in the inbound message.
The plugin is configured in the rabbitmq.config
or advanced.config
files for RabbitMQ versions 3.6.x
and/or 3.7.x
respectively, as follows:
[{rabbitmq_message_persister,
[
{delivery_mode, 2}
]
}].
This plugin cannot be used together with the following plugins:
as they override the same AMQP primitive.
To create a package, execute make dist
and find the .ez
package file in the
plugins
directory. Refer to the standard RabbitMQ Plugin Installation Guide for more details on
installing plugins that do not ship with RabbitMQ by default.
Clone and execute make tests
to test the plugin. View test results from the
generated HTML files.
Enable the plugin with the following command:
rabbitmq-plugins enable rabbitmq_message_persister
(c) Erlang Solutions Ltd. 2017-2018