...
For the solution, we can use the library “org.apache.kafka.clients.admin.AdminClient
that is an Admin Kafka Client. The functionality functionalities that we are interested are: check if Kafka Nodes are available and fetch the topics configured in Kafka.
Currently the implementation is base with an abstract layer of infrastructure, and the connection to Kafka is implemented in policy/common. So policy/common will be the best place to implement the Admin “Kafka health check” and “fetch Kafka topics“.
The health check will be implemented using a new specific abstract layer, the class “TopicParameters
" can be used to fetch properties from properties file, for the admin connection to Kafka.
The Kafka configuration implemented into the “IntermediaryActivator“ constructor class, has to be move in a method, so the class can be created with no issue related to Kafka connection.