# Broker address
amqp_url = "amqps://{{ fedora_messaging_username }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"
callback = "fedora_messaging.example:printer"

# In the production/private rabbitmq servers clients can't create
# queues dynamically. The client defaults to trying to create them.
# Setting this to true means the client will not attempt to create
# the queue on the server, but will just check to make sure it exists
# and configured correctly.
passive_declares = true

[tls]
ca_cert = "/etc/pki/fedora-messaging/{{ fedora_messaging_ca_file }}"
keyfile = "/etc/pki/fedora-messaging/{{ fedora_messaging_key_file }}"
certfile = "/etc/pki/fedora-messaging/{{ fedora_messaging_cert_file }}"

# Set the Application name/url/email
[client_properties]
app = "CoreOS OSTree Importer"
app_url = "https://github.com/coreos/fedora-coreos-releng-automation/tree/master/coreos-ostree-importer"
app_contacts_email = ["coreos@lists.fedoraproject.org"]

[exchanges."amq.topic"]
type = "topic"
durable = true
auto_delete = false
arguments = {}

# We'll use the coreos queue name
[queues."{{ fedora_messaging_queue_name }}"]
durable = true
auto_delete = false
exclusive = true
arguments = {}

# We care about the ostree-import message topic
[[bindings]]
queue = "{{ fedora_messaging_queue_name }}"
exchange = "amq.topic"
routing_keys = [
{% for key in fedora_messaging_routing_keys %}
    "{{ key }}",
{% endfor %}
]

[consumer_config]
example_key = "for my consumer"

[qos]
prefetch_size = 0
prefetch_count = 25

[log_config]
version = 1
disable_existing_loggers = true

# Adjust the log formatting based on preference
[log_config.formatters.simple]
format = "%(asctime)s %(levelname)s %(name)s - %(message)s"

[log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"

# Set level to WARNING, otherwise too chatty
[log_config.loggers.fedora_messaging]
level = "WARNING"
propagate = false
handlers = ["console"]

# Set level to WARNING, otherwise too chatty
[log_config.loggers.twisted]
level = "WARNING"
propagate = false
handlers = ["console"]

[log_config.loggers.pika]
level = "WARNING"
propagate = false
handlers = ["console"]

# If your consumer sets up a logger, you must add a configuration for it
# here in order for the messages to show up. e.g. if it set up a logger
# called 'example_printer', you could do:
#[log_config.loggers.example_printer]
#level = "INFO"
#propagate = false
#handlers = ["console"]

[log_config.root]
level = "ERROR"
handlers = ["console"]
