mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-19 17:26:51 +00:00
feat: add max-retry-attempts config option
This commit is contained in:
parent
50b8f7bbd4
commit
61e5273158
@ -30,7 +30,8 @@ data class AppConfigProperties(
|
||||
replacement = "app.pseudonymize.generator"
|
||||
)
|
||||
var pseudonymizer: PseudonymGenerator = PseudonymGenerator.BUILDIN,
|
||||
var transformations: List<TransformationProperties> = listOf()
|
||||
var transformations: List<TransformationProperties> = listOf(),
|
||||
var maxRetryAttempts: Int = 3
|
||||
) {
|
||||
companion object {
|
||||
const val NAME = "app"
|
||||
|
@ -113,11 +113,11 @@ class AppConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun retryTemplate(): RetryTemplate {
|
||||
fun retryTemplate(configProperties: AppConfigProperties): RetryTemplate {
|
||||
return RetryTemplateBuilder()
|
||||
.notRetryOn(IllegalArgumentException::class.java)
|
||||
.exponentialBackoff(2.seconds.toJavaDuration(), 1.25, 5.seconds.toJavaDuration())
|
||||
.customPolicy(SimpleRetryPolicy(3))
|
||||
.customPolicy(SimpleRetryPolicy(configProperties.maxRetryAttempts))
|
||||
.withListener(object : RetryListener {
|
||||
override fun <T : Any, E : Throwable> onError(
|
||||
context: RetryContext,
|
||||
|
Loading…
x
Reference in New Issue
Block a user