amqp_url = "amqps://mts{{ env_suffix }}:@rabbitmq{{ env_suffix }}.fedoraproject.org/%2Fpubsub"

{% if env == "staging" %}
topic_prefix = "org.fedoraproject.stg"
{% else %}
topic_prefix = "org.fedoraproject.prod"
{% endif %}

publish_exchange = "amq.topic"
passive_declares = true

[tls]
ca_cert = "/etc/pki/fedora-messaging/mts.ca"
certfile = "/etc/pki/fedora-messaging/mts.crt"
keyfile = "/etc/pki/fedora-messaging/mts.key"


[client_properties]
app = "Message Tagging Service"
app_url = "https://github.com/fedora-modularity/message-tagging-service"
app_version = "latest"
app_contacts_email = ["yzhu@redhat.com"]

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

[queues."mts{{ env_suffix }}"]
{% if env == "staging" %}
durable = false
auto_delete = true
{% else %}
durable = true
auto_delete = false
{% endif %}
exclusive = false
arguments = {}

[[bindings]]
queue = "mts{{ env_suffix }}"
exchange = "amq.topic"
routing_keys = ["org.fedoraproject.*.mbs.module.state.change"]

# Added because MBS has not been migrated to fedora-messaging
[[bindings]]
queue = "mts{{ env_suffix }}"
exchange = "zmq.topic"
routing_keys = ["org.fedoraproject.*.mbs.module.state.change"]

[qos]
prefetch_size = 0
prefetch_count = 25

[log_config]
version = 1
disable_existing_loggers = true

[log_config.formatters.simple]
format = "[%(levelname)s %(name)s] %(message)s"

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

[log_config.loggers.fedora_messaging]
level = "INFO"
propagate = false
handlers = ["console"]

[log_config.loggers.twisted]
level = "INFO"
propagate = false
handlers = ["console"]

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

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