There are some scenario where participant when starting, is not able to connect properly with Kafka:
Participant start before Kafka is up and running
Participant start after Kafka is up and running, but the topics are not available yet
Due the failing during the initial configuration, that create a chain of errors, and the participant application is crashing.
In the scenario that the Kafka topic are created from an external code configured into the ACM-Runtime chart, the ACM-Runtime will be not affected.
For the solution, we can use the library “org.apache.kafka.clients.admin.AdminClient
that is an Admin Kafka Client. The functionality 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“.