Search code examples
amazon-web-servicesspring-bootapache-kafkaspring-kafkaaws-msk

AWS MSK Spring Boot App Example Using IAM


I want to create a Spring Boot App that connect to AWS MSK using IAM and produces and consumes event i looked over the internet but was not able to find any good resources

Note: I have deployed my a demo app hello world app on AWS EKS.


Solution

  • You can see a reference to a client.properties file in the docs.

    ssl.truststore.location=<PATH_TO_TRUST_STORE_FILE>
    security.protocol=SASL_SSL
    sasl.mechanism=AWS_MSK_IAM
    sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule required;
    sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler
    

    Spring-Kafka uses the same attributes under spring.kafka.properties