Dear Kafka Community,
I am reaching out for guidance on how to retrieve the current user who is
attempting to create a topic within the CreateTopicPolicy implementation in
Apache Kafka. Our goal is to restrict topic creation based on a configured
maximum limit for each user.
While working on implementing the topic creation restriction based on a
user-specific configured maximum limit, I found that the CreateTopicPolicy
interface provides limited data through the RequestMetadata object,
including parameters like numPartitions and replicationFactor. However, it
does not straightforwardly provide the username or user-specific
information required for policy enforcement.
Our objective is to identify the current user creating the topic within the
CreateTopicPolicy and use this information to enforce topic creation
restrictions based on the maximum configured limit for each user.
I have developed a solution in a Java application using Kafka APIs to
retrieve user-specif...