I have the following two cases
Provide a SimpleRetryPolicy with a map of exceptions and booleans (whether or not to retry). You can optionally traverse the exception cause tree to find the specific exception. See the Javadocs for SimpleRetryPolicy.
SimpleRetryPolicy