principal.builder.class #6389
Replies: 6 comments 14 replies
-
You will have to build your class into a JAR and build your own container images with your custom JAR in the classpath. |
Beta Was this translation helpful? Give feedback.
-
I am clear on building the jar and creating a container image using jib. But not sure how KAFKA will use this image when I install the manifest. Or are you referring me rebuilding the kafka container image instead of using image provided in quay by srimzi? Really sorry beginner in K8S space, any documentation as to how to implement this will be a real help. |
Beta Was this translation helpful? Give feedback.
-
@scholzj again a basic Q. sorry. when I copy the jar to library should I be doing this COPY KafkaCustomBuilder-1.0-SNAPSHOT.jar libs/ or this way COPY KafkaCustomBuilder-1.0-SNAPSHOT.jar /opt/kafka/libs/ |
Beta Was this translation helpful? Give feedback.
-
second it is then :-) |
Beta Was this translation helpful? Give feedback.
-
@scholzj I tried with no ENV set but again same error. 2022-02-25T10:24:24.705566848Zorg.apache.kafka.common.config.ConfigException: Invalid value CommonNamePrincipalBuilder.class for configuration principal.builder.class: Class CommonNamePrincipalBuilder.class could not be found. at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:744) at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:490) at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:483) at org.apache.kafka.common.config.AbstractConfig.(AbstractConfig.java:113) at org.apache.kafka.common.config.AbstractConfig.(AbstractConfig.java:146) at kafka.server.KafkaConfig.(KafkaConfig.scala:1463) at kafka.server.KafkaConfig.(KafkaConfig.scala:1466) at kafka.Kafka$.buildServer(Kafka.scala:67) at kafka.Kafka$.main(Kafka.scala:87) at kafka.Kafka.main(Kafka.scala) Any help on how I can debug this problem further ? please let me know. On class - I am following similar way as what was on example hence did'nt package it up. I could give a try with packaging it up. but should I follow any specific kafka packing standard like org.kaka. or can I use usual package like any jar's? as in |
Beta Was this translation helpful? Give feedback.
-
HI, got the class added to classpath and now the custom class I am passing is getting picked up. but I am getting the below error and broker is not starting 2022-02-28T17:12:45.005372133Zjava.lang.IllegalArgumentException: requirement failed: principal.builder.class must implement KafkaPrincipalSerde at scala.Predef$.require(Predef.scala:337) at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:2189) at kafka.server.KafkaConfig.(KafkaConfig.scala:1992) at kafka.server.KafkaConfig.(KafkaConfig.scala:1466) at kafka.Kafka$.buildServer(Kafka.scala:67) at kafka.Kafka$.main(Kafka.scala:87) at kafka.Kafka.main(Kafka.scala) my class does implement as follows so not sure what I am doing wrong : public class CustomCNPrincipalBuilder implements KafkaPrincipalBuilder |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A basic Q, new to K8s , we want to implement the principal.builder.class , the example I got from from link (https://github.com/strimzi/strimzi-kafka-operator/blob/7b020f17e9bd93d5dcd26bbb9bbca64a7da696b8/documentation/api/io.strimzi.api.kafka.model.listener.KafkaListenerAuthenticationCustom.adoc) I am assuming SimplePrincipal.class is going to the class which I write for my use case, but not sure how kafka during broker setup will pick this up?
IS there any example which shows the pre-requisite to setup K8S such that we can use the config as below? Any help or link to understand how this setup is done will be really appreciated
spec:
kafka:
config:
principal.builder.class: SimplePrincipal.class
Beta Was this translation helpful? Give feedback.
All reactions