Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property to configure Spring Kafka's authExceptionRetryInterval #44199

Closed
cabbonizio opened this issue Feb 10, 2025 · 1 comment
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@cabbonizio
Copy link

Hi there I have a spring boot app that makes use of both a kafka consumer and producer. I have been able to configure mostly everything with YAML properties but one property I am coming up short is:

org.springframework.kafka.listener.ConsumerProperties.authExceptionRetryInterval (java.time.Duration)

It seems like this property should be included in the org.springframework.boot.autoconfigure.kafka.Listener static configuration class, but I don't see it. Based on the configuration of Spring Kafka, I think this should be the logical place to put it, for instance like so:

spring:
  kafka:
    listener:
      auth-exception-retry-interval: 30s
      ack-mode: record
      concurrency: 2
      client-id: sample
    retry:
      topic:
        attempts: 5
        backoff:
          delay: 5000         
    bootstrap-servers:
    - xxxxxxxxxxxxxxxxxxxxx
    producer:
      transaction-id-prefix: ${spring.application.name}			
      key-serializer: org.springframework.kafka.support.serializer.JsonSerializer
      value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
      compression-type: zstd
      retries: 5
      properties:
        "[linger.ms]": 1
    consumer:
      group-id: sample
      key-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
      value-deserializer: org.springframework.kafka.support.serializer.JsonSerializer
      auto-offset-reset: latest
      properties:
        "[spring.json.trusted.packages]": com.sample
        "[spring.json.use.type.headers]": false
    properties:
      "[security.protocol]": SASL_SSL
      "[sasl.mechanism]": SCRAM-SHA-512
      "[sasl.jaas.config]": ${kafka.sasl.jaas.config}

Unless I am missing something would it be possible to add this in as an enhancement, as this allows one to go full configuration based auto-configuration without the need of defining a custom property.

many thx!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 10, 2025
@mhalbritter mhalbritter changed the title Spring Boot Property for Spring Kafka authExceptionRetryInterval Add property to configure Spring Kafka's authExceptionRetryInterval Feb 19, 2025
@mhalbritter mhalbritter added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 19, 2025
@mhalbritter mhalbritter added this to the 3.5.x milestone Feb 19, 2025
@mhalbritter mhalbritter modified the milestones: 3.5.x, 3.5.0-M2 Feb 19, 2025
@mhalbritter mhalbritter self-assigned this Feb 19, 2025
@cabbonizio
Copy link
Author

@mhalbritter many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants