I have a RabbitMQ shovel that I have been using for some time.
I have a PC ‘192.168.7.1’ that is shovelling messages from another PC ‘192.168.7.6’. This works unless ‘192.168.7.6’ reboots, then the shovel on ‘192.168.7.1’ stays in the RUNNING state and never again receives messages and also never reconnects. So messages just buffer up on ‘192.168.7.6’ indefinitely.
Here is an excerpt from my config file showing the shovel config:
[{rabbit, [{disk_free_limit, {mem_relative, 1.0}}]},
{rabbitmq_shovel,
[ {shovels, [ {backbone_shovel,
[ {sources,
[ {brokers, [ "amqp://guest:guest@192.168.7.6"
]}
, {queue.declare, [
{queue, <<"backbone">>}
, durable
]}
]}
, {destinations,
[ {broker, "amqp://guest:guest@localhost"}
, {queue.declare, [
{queue, <<"backbone">>}
, durable
]}
]}
, {queue, <<"backbone">>}
, {ack_mode, on_confirm}
, {reconnect_delay, 5}
]},
Here is an excerpt from the rabbitmq shovel management plugin when the source (192.168.7.6) is rebooting:
backbone_shovel
running
type: network
virtual_host: /
host: 192.168.7.6
username: guest
ssl: false
type: network
virtual_host: /
host: localhost
username: guest
ssl: false
2012-11-26 11:03:51
How can I force a shovel to restart when the target dies?
Answering my own question just in case anyone else has the same problem.
This simple solution is to put the shovel on the client (PC ‘192.168.7.6’) instead of the server (PC ‘192.168.7.1’). Then if the client restarts, the shovel restarts. So the shovel never gets out of sync with the state of the client.