Currently all services using the message queue call exchange_declare with passive flag set to false (default when omitted). This means that if the specified exchange does not already exist it will be created with the config passed by the caller.
This may be error prone and lead to issues in the future as multiple services may try to declare the same exchange with different config and whatever service gets to declare the queue first decides the config.
Modifying the exchange config currently requires modifying the exchange_declare call of all services to keep them in sync.
Proposal
Let the rabbitmq container declare the exchange on boot (container config)
Set the passive flag of all services calling declare_exchange to true
Currently all services using the message queue call exchange_declare with passive flag set to false (default when omitted). This means that if the specified exchange does not already exist it will be created with the config passed by the caller.
This may be error prone and lead to issues in the future as multiple services may try to declare the same exchange with different config and whatever service gets to declare the queue first decides the config.
Modifying the exchange config currently requires modifying the exchange_declare call of all services to keep them in sync.
Proposal