Micronaut Kafka config using environment variables

Viewed 13

I have some Micronaut based microservices which are deployed as Docker containers on K8s. Now, in each service, I want to configure the default session timeout for Kafka consumers as specified here - https://micronaut-projects.github.io/micronaut-kafka/latest/guide/.

kafka:
  consumers:
     myGroup:
        session:
            timeout:
                ms: 30000

But instead of going to individual service and change their application.yml, I want to configure it using environment variables which would be injected using K8s configmaps.

So, I tried adding following property in configmap:

KAFKA_CONSUMERS_DEFAULT_SESSION_TIMEOUT_MS: 45000

and I verified that it was injected in the container environment.

But still the Kafka Consumers do not use this property and it takes its default value of 10000.

Can someone tell me if this is possible or do I need to put the value into application.yml only?

0 Answers
Related