-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore if RabbitMQ can load and validate its config file instead of application_controller #551
Comments
It would be interesting to know what @essen, @dcorbacho, @Ayanda-D, and @Dzol think of this. While #550 is going to happen, supporting Erlang term file configs would be very nice for backwards compatibility. We don't use any particularly sophisticated data structures so there should be a way to do that by coercing YAML to the Erlang terms we use today. |
As I remember, Riak and Ejabberd use additional |
So they effectively load two configs and merge them? That sounds reasonable for us. |
Riak is not using YAML, they use this https://github.com/basho/cuttlefish |
OK. Whether or not we want to use the same format and Cuttlefish belongs to #550. Is the generated |
It is loaded by application controller just like regular |
So in other words, if we are to follow this route (which is quite clever IMO), validation would be handled in #550 and this issue should be simply closed because there's no real need to do this. Any objections to this approach? Also, @hairyhum please take a look at how they handle file generation (e.g. where the target file is located — is it next to the source one?) and how we can make it work with our current way of setting config file path (which is via environment variables). This also can complicate upgrades, so we need to consider that. |
Riak use I also looked at |
Might be a bit off direction to where discussion is going so far, but how fine-grain is the validation going be? And at the moment |
@Ayanda-D yes, your thinking about the kind validation we could provide is close to what I had in mind. |
I'm researching cutterfish config generation for rabbitmq config right now and there are some questionable behaviour. Using string parsing:
.schema file:
Using multiple parameters:
.schema file:
Both ways will generate same result, but I'm not sure which will be better for users to understand. |
There is also an option to encode values to setting key. So previous examples will look like
Which can be translated by translation function to same result. But in current example it is not so flexible, but maybe could be used in following example:
Schema:
|
Good finding @hairyhum. This alone may be what tips the scale towards YAML: collections are well covered there. Choices, choices. |
So here is There are You can run @michaelklishin @dumbbell @essen @Ayanda-D can you look at |
It looks pretty good. Some names may be worth revisiting and some examples are missing (e.g. with multiple listeners) but it does demonstrate that Cuttlefish is quite adaptable. @hairyhum please continue expanding the example with more cases (and settings, we likely don't list 100% there). I'm personally increasingly warming up to the idea of using Cuttlefish with its native sysctl format with a custom mapping over YAML. |
Speaking about custom mapping, there are several ways to do hierarchical configs (like listeners), and some of them will require more patching. listener.tcp.local = 127.0.0.1:5678
listener.tcp.host = 10.0.0.10:5678 Yaml simple mapping (same as listener.tcp.local : 127.0.0.1:5678
listener.tcp.host : 10.0.0.10:5678 Yaml extended mapping (may require some listeners:
tcp:
- 127.0.0.1:5678
- 10.0.0.10:5678 |
This would give us some specific improvements:
This is also a good step towards #550 and should be investigated before it so that we have a more informed opinion.
We should also explore Riak's approach and sub-projects in this area.
The text was updated successfully, but these errors were encountered: