bloomberg / amqpprox

An AMQP 0.9.1 proxy server, designed for use in front of an AMQP 0.9.1 compliant message queue broker such as RabbitMQ.
Apache License 2.0
78 stars 16 forks source link

populate d_mappings from conf file? #60

Closed bechampion closed 2 years ago

bechampion commented 3 years ago

Hi! I can't find this in the github repo or in the code , but is there any way to load mappings and other configurations from a file? I am looking at the code and it seems that the map vhost to backend is mainly being held in memory and load through the cli .

I personally need this to guarantee that on failure the apps comes back with the same conf (could be done with systemd hooks , but a config file would be nicer?)

Thank you for putting this on github , been waiting for something like this for quite a while.

adamncasey commented 3 years ago

Hey @bechampion, thanks for the question.

There is no config file for amqpprox. The main reason for this the awkwardness around synchronising up front/static config with dynamic config updates.

As described in https://github.com/bloomberg/amqpprox/issues/58 - our setup is similar to how you describe, our start script for the proxy invokes amqpprox, and then also sends it all of the config known up front.

Does this answer your question?

bechampion commented 3 years ago

Hey @adamncasey no worries, i will let systemd populate the config post start , and unblock with iptables once its al ready . thank you for this product!

adamncasey commented 2 years ago

Unblocking with iptables seems fine, though I'm not sure if you noticed that you can also tell amqpprox to listen over the control socket too.

This way you can pass all of the configuration to amqpprox, then tell it to start listening. This is what we do - might simplify things a little?