Skip to content

Nice to have: notRetryOn() and retryOn() in RetryTemplateBuilder #254

@hotire

Description

@hotire

Summary

I noted this while using the RetryTemplateBuilder.

https://github.com/spring-projects/spring-retry/blob/main/src/main/java/org/springframework/retry/support/RetryTemplateBuilder.java#L285

It would be nice to support list parameter like RetryTopicConfigurationBuilder in spring-kafka

https://github.com/spring-projects/spring-kafka/blob/main/spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurationBuilder.java#L308

Sample

public RetryTemplateBuilder notRetryOn(List<Class<? extends Throwable>> throwables) {
       for (final Class<? extends Throwable> throwable : throwables) {
		classifierBuilder().notRetryOn(throwable);
	}
	return this;
}
public RetryTemplateBuilder retryOn(List<Class<? extends Throwable>> throwables) {
	for (final Class<? extends Throwable> throwable : throwables) {
		classifierBuilder().retryOn(throwable);
	}
	return this;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions