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

SimpleRetryPolicy javadoc is missing some important informations [BATCH-1941] #1651

Closed
spring-issuemaster opened this issue Jan 4, 2013 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jan 4, 2013

Sebastien Lorber opened BATCH-1941 and commented

My usecase was pretty simple:

I wanted a RetryPolicy that would retry all Exception class and subclasses, except a custom exception NoRetryException - which is a RuntimeException - which would make the RetryTemplate abord the retries.

After reading the Javadoc and code of some retry classes of the Retry/Batch framework, I found out that I had to create my custom RetryPolicy.

Finally after loosing some time I noticed something: the use of a TreeSet and of org.springframework.classify.SubclassClassifier.ClassComparator

This means that my usecase was handled by SimpleRetryPolicy, but the Javadoc doesn't mention it. Perhaps for some people it seems to be the obvious behavior, but it was not for me.

The Javadoc doesn't mention this on class level javadoc of BinaryExceptionClassifier and SubclassClassifier too.

"If the object to be classified is one of the keys of the provided
map, or is a subclass of one of the keys, then the map entry value for that
key is returned."

The only Javadoc reference to this feature is:
"Return the value from the type map whose key is the class of the given Throwable, or its nearest ancestor if a subclass."

I think this should be better explained on the SimpleRetryPolicy


Affects: 2.1.9

@benas
Copy link
Contributor

@benas benas commented Jan 20, 2020

SimpleRetryPolicy is not part of Spring Batch anymore, we can't change its Javadoc here. It is now part of spring-retry project.

The Javadoc doesn't mention this on class level javadoc of BinaryExceptionClassifier and SubclassClassifier too.

The class level Javadocs of both BinaryExceptionClassifier and SubclassClassifier mention that:

If the object to be classified is one of the provided types, or is a subclass of one of the types, then the non-default value is returned (usually true).

I think this should be better explained on the SimpleRetryPolicy

The Javadoc of SimpleRetryPolicy mentions that as well:

Simple retry policy that retries a fixed number of times for a set of named exceptions (and subclasses)

I believe this is outdated so I'm closing this issue for now. If you think this is not clear enough, please open this issue against spring-retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.