Search code examples
spring-bootapache-kafkaspring-kafka

How can I set max.incremental.fetch.session.cache.slots in application.yml


I'm using Kafka + Spring, my doubt is how can I set this config max.incremental.fetch.session.cache.slots in application.yml

Because I've been receiving this message in logs:

[Consumer clientId=client-valid-0, groupId=valid-group] Node 11103 was unable to process the fetch request with (sessionId=1130053497, epoch=425): FETCH_SESSION_ID_NOT_FOUND.

Solution

  • See the Spring Boot Documentation:

    https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.messaging.kafka.additional-properties

    Only a subset of the properties supported by Kafka are available directly through the KafkaProperties class. If you wish to configure the producer or consumer with additional properties that are not directly supported, use the following properties:

    spring:
      kafka:
        properties:
          "[prop.one]": "first"
        admin:
          properties:
            "[prop.two]": "second"
        consumer:
          properties:
            "[prop.three]": "third"
        producer:
          properties:
            "[prop.four]": "fourth"
        streams:
          properties:
            "[prop.five]": "fifth"
    

    This sets the common prop.one Kafka property to first (applies to producers, consumers and admins), the prop.two admin property to second, the prop.three consumer property to third, the prop.four producer property to fourth and the prop.five streams property to fifth.