Skip to content

Commit

Permalink
Updated Spring
Browse files Browse the repository at this point in the history
Co-authored-by: Øyvind Norsted Wedøe <[email protected]>
  • Loading branch information
flexable777 and oyvind-wedoe committed Aug 31, 2022
1 parent 617d1c2 commit e75af37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repositories {

plugins {
id("org.jetbrains.kotlin.jvm") version "1.7.10"
id("org.springframework.boot") version "2.5.12"
id("org.springframework.boot") version "2.7.3"
id("org.jetbrains.kotlin.plugin.spring") version "1.7.10"
idea
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.springframework.kafka.core.DefaultKafkaConsumerFactory
import org.springframework.kafka.core.DefaultKafkaProducerFactory
import org.springframework.kafka.core.KafkaTemplate
import org.springframework.kafka.listener.DeadLetterPublishingRecoverer
import org.springframework.kafka.listener.SeekToCurrentErrorHandler
import org.springframework.kafka.listener.DefaultErrorHandler
import org.springframework.util.backoff.FixedBackOff
import java.time.Duration

Expand Down Expand Up @@ -61,13 +61,13 @@ class AivenKafkaConfiguration(
r.partition()
)
}
factory.setErrorHandler(
SeekToCurrentErrorHandler(recoverer, FixedBackOff(0L, 2L))
factory.setCommonErrorHandler(
DefaultErrorHandler(recoverer, FixedBackOff(0L, 2L))
)

//Retry consumer/listener even if authorization fails at first
factory.setContainerCustomizer { container ->
container.containerProperties.authorizationExceptionRetryInterval = Duration.ofSeconds(10L)
container.containerProperties.setAuthExceptionRetryInterval(Duration.ofSeconds(10L))
}

return factory
Expand Down

0 comments on commit e75af37

Please sign in to comment.