defaults: &defaults
  host: localhost
  port: 5672
  vhost: /
  user: publishing_api
  pass: publishing_api
  recover_from_connection_close: true

development:
  <<: *defaults
  exchange: published_documents

test:
  <<: *defaults
  exchange: published_documents_test

production:
  hosts:
    <% hosts = ENV['RABBITMQ_HOSTS'] || 'localhost' %>
    <% hosts.split(",").each do |host| %>
    - <%= host %>
    <% end %>
  user: publishing_api
  pass: <%= ENV['RABBITMQ_PASSWORD'] %>
  port: 5672
  vhost: /
  exchange: published_documents
  recover_from_connection_close: true

defaults: &defaults
  port: 5672
  vhost: /
  user: publishing_api
  pass: publishing_api
  recover_from_connection_close: true

development:
  <<: *defaults
  host: localhost
  exchange: published_documents

test:
  <<: *defaults
  host: localhost
  exchange: published_documents_test

production:
  <<: *defaults
  hosts:
    <% hosts = ENV['RABBITMQ_HOSTS'] || 'localhost' %>
    <% hosts.split(",").each do |host| %>
    - <%= host %>
    <% end %>
  user: publishing_api
  pass: <%= ENV['RABBITMQ_PASSWORD'] %>
  port: 5672
  vhost: /
  exchange: published_documents
  recover_from_connection_close: true

Change RabbitMQ configuration to use defaults everywhere
Change RabbitMQ configuration to use defaults everywhere

So use the defaults for production, not just staging and
integration. This requires removing the host from the defaults, as
hosts is used in production.
