alphagov/content-store — pull request #61 by alext (2014-10-15 16:27:48+00:00)
Title:  Create a new AMQP channel for each message.

The app currently breaks if the rabbitmq server goes down, and a message
is attempted to be sent while it's down. This does not recover when the
rabbitmq server returns. The reason for this is that the
wait_for_confirms mechanism blocks and times out because it's waiting
for a confirm for the message that was dropped - the confirm set is
per-channel.

We can avoid this by creating a new channel for each message. This
doesn't incur much penalties because channels are "lightweight
connections that share a single TCP connection"[1].

[1] http://www.rabbitmq.com/tutorials/amqp-concepts.html#amqp-channels