Add retry interceptor for Query execution related failures
Add full retry for Token exchange failures
Introduce new TokenException
Instead of SQLException, TokenException would be thrown/returned by TokenHelper
Use separate clients for token exchange and query execution (both share base client so resources would be shared)
Add support to pass maxRetries as client property, defaults to 3
Segregate error messages by case
Questions
TokenHelper throws TokenException, previously it threw SQLException. So, it would be breaking sort of change. There are 2 ways to handle it or is this change acceptable? As this is internal logic, would it be okay with this change or should we be more conservative?
Deprecate TokenHelper and introduce TokenProvider
wrap all exceptions and emit SQLException from getToken
Should we expose maxRetries to users?
Uses FailSafe library for retries (Apache license should be good). Should we include additional library or just have simple retry mechanism?
NOTE: I have left some fixme, todo comments for future changes
Changes
Questions
getToken