Additional options for kafka clients #2281
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to enable ssl encryption and authentication for the kafka communications in the alarm-system. This reqires several additional settings for the kafka consumer and producers.
This PR adds a kafka_properties preference to the phoebus client and a corresponding cmd option to the alarm-server, alarm-logger and alarm-config-logger. This preference is a path to a properties file to load additional kafka-client properties from. The properties file format and content is the same as the one for the kafka-console clients. This should provide a lot of flexibility to configure the kafka clients without adding a lot of extra preferences to phoebus.
In addition, I tried to add this to the existing cmd parse logic in the alarm-server. However, I found it very complicated to add an additional argument in the existing structure, while also ensuring that all combinations and also orders of arguments work properly. So, I rewrote the cmd argument parsing making the processing independent of the order the arguments were given. Hopefully, this makes it a bit more flexible and it removed some of the repetitive code.