alphagov/content-store — pull request #77 by rboulton (2014-11-17 14:22:20+00:00)
Title: Set routing key for heartbeat messages

The routing key needs to be part of the options passed to Bunny's
exchange.publish method, not part of the message body. See
http://www.rubydoc.info/github/ruby-amqp/bunny/Bunny/Exchange#publish-instance_method

The publish options aren't all headers, so call them `message_options`
instead of `message_headers`. Change signature of the
GovukExchange.publish method to match that of Bunny's Exchange.publish
method (by making it have a second parameter of options with a default
of {}, rather than a named parameter called headers which requires a
hash), for a less surprising API.

Also, add "persistent: false", to indicate that we don't require the
heartbeat to be persisted on failure (this is the default, but
specifying it explicitly informs future readers that this is a
deliberate choice, since we choose to have persistent: true for
non-heartbeat messages).