Open tzookb opened 1 year ago
Depending on how you are running your consumer, you need to add the aws-msk-iam-auth library to the classpath differently. Some options are:
(1) add it to the project dependencies using for example the maven repo in the ReadMe then build the project. (2) add it to the java env classpath like you are doing in your example. (3) add it to external jar files manifest files.
About (3), running an already existing jar file will probably override the env classpath with the internals META-INF/MANIFEST.mf file class-path, so you need to edit it to let it know where to find this external jar library.
From https://javarevisited.blogspot.com/2011/01/how-classpath-work-in-java.html#axzz7qlxl0T5c In this case, you can set your Java classpath in the META-INF/MANIFEST.MF file by using the Class-Path attribute. In short Class-path attribute in manifest file overrides classpath specified by -cp, -classpath or CLASSPATH environment variable.
How to edit an existing jar file's MANIFEST: https://stackoverflow.com/questions/22682809/how-can-i-change-manifest-file-in-java
Extract the manifest: jar xvf MyProject.jar META-INF/MANIFEST.MF
Edit the manifest
Reinsert the edited manifest: jar uvf MyProject.jar META-INF/MANIFEST.MF
For 3. I actually use (add the M option) jar uMvf MyProject.jar META-INF/MANIFEST.MF
I was able to solve this issue by copying aws-msk-iam-auth-1.1.1-all.jar
into kafka_2.12-2.8.1/libs/
I was able to solve this issue by copying
aws-msk-iam-auth-1.1.1-all.jar
intokafka_2.12-2.8.1/libs/
thanks, worked for me too
It doesn't seem to be working using kafka_2.13-2.8.2
; works with kafka_2.12-2.8.2
.
Thanks, it worked for me too
We are facing the same issue when we are trying to use the IAM authentication from kafka connect.
We are getting Invalid value software.amazon.msk.auth.iam.IAMClientCallbackHandler for configuration sasl.client.callback.handler.class: Class software.amazon.msk.auth.iam.IAMClientCallbackHandler could not be found.
We are using the confluentinc/cp-kafka-connect-base
image with version 7.5.0.
So, while creating our image, which will use the IAM auth, we are using the latest jar of version 2.0.3.
In this image, we are copying this jar into the following path
/usr/share/java/
/etc-kafka-connect/jars
/usr/share/java/cp-base-new
We are running our kafka-connect
in the distributed mode.
We have also set the CLASSPATH in the docker file as an environment variable to this path /usr/share/java/
.
Also, we have set the plugin path for our kafka-connect
to /usr/share/java,/usr/share/confluent-hub-components
But after all this, we still get the same error mentioned above.
Do you guys have any idea on how to resolve this issue?
@Devarsh23 Doing the following while building the connect image worked for me:
FROM confluentinc/cp-kafka-connect-base:latest
COPY aws-msk-iam-auth-2.0.3-all.jar /usr/share/java/kafka
keep getting this error:
I saw it was noted in the troubleshooting and it says to:
I tried to do it with this command below: my command
but I still get the same error. anything Im missing?