kafka-configurator
kafka-configurator copied to clipboard
Kafka Configurator as an external library which can be called from Java code
There are scenarios where is convenient to run Kafka Configurator as an external library from Java code. But there are some obstacles in that:
- Due to Scala/Java paradigm mismatch, there is no pretty way to process case classes in Java, the result of Kafka Configurator work is exactly that class.
- Calling of
run(...).get()yields in Tuple2<List<ConfiguratorFailure>,List<String>> result type which cannot be processed from the outer code due to package restriction of ConfiguratorFailure class.
It would be nice to have:
- A dedicated function which result can be elegantly processed in Java code
- Positive results can be exposed as a List<String> as it returned in Tuple2 result of Scala code
- Negative results could be propagated as Exception class descendants (either Runtime one, or not)
- Scala provides a list of ConfiguratorFailure but it's enough to return to Java a Throwable instance got from the head of this list (if we have got sufficient logging on Scala side)
@mc-alesha thanks for raising the issue. I am on holiday this week, but we will be discussing the best way to proceed with this when I am back.
@mc-alesha just to let you know that I am back and we will be discussing this today or tomorrow, will keep you updated.