kafka-configurator icon indicating copy to clipboard operation
kafka-configurator copied to clipboard

Kafka Configurator as an external library which can be called from Java code

Open aaaleshaaa opened this issue 7 years ago • 2 comments

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)

aaaleshaaa avatar Jul 26 '18 14:07 aaaleshaaa

@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.

lacarvalho91 avatar Jul 29 '18 16:07 lacarvalho91

@mc-alesha just to let you know that I am back and we will be discussing this today or tomorrow, will keep you updated.

lacarvalho91 avatar Aug 07 '18 09:08 lacarvalho91