-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support for retry mechanism in SDK #410
Comments
This feature is going to be provided from the If you need the feature immediately you can temporarily workaround the limitation by using an axios retry plugin e.g. const rax = require('retry-axios');
client.getHttpClient().defaults.raxConfig = {
// ... retry-axios config options
instance: client.getHttpClient(),
};
rax.attach(client.getHttpClient()); or const axiosRetry = require('axios-retry');
axiosRetry(client.getHttpClient(), {
// ... axios-retry config options
},
}); Note: snippets updated to use official |
Any alternatives for TypeScript users as this one fails, because TS doesn't allow me to access a private member of |
Same as #408 (comment) from the next release TS users will be able to get the axios instance to do a workaround until the core provides built-in retries. |
Ah, brilliant! When is this going to be released? |
Hopefully no later than the end of the month. |
Nice, looking forward to it :) |
0.0.18 released today with support for
to access the axios instance (even in TS). To be clear enabling retries via user-supplied plugins to axios is still a workaround. I'm leaving this open until we have the built-in retry support (which is hopefully coming soon in the core, see IBM/node-sdk-core#156). |
Thank you @ricellis! For now this will do. |
I'm going to close this as we've picked up the new |
Hi @ricellis , when will 0.0.19 be released? |
Hopefully sometime in the next week. |
Hi @ricellis , Does this release include retry options other than maxRetries, maxRetryInterval, I wanted a parameter which could support retryStatusCodes, I have tried the same parameter which is supported by axios but it doesnt seem to work with enableRetries(), below is my sample snippet
|
@kvv002 The If you'd like to see an enhancement to the core to support configuration of alternative codes you can raise an issue there for discussion. Alternatively you can use the workaround above to configure custom retries instead of using the built-in support. FWIW I can't think of anywhere in the API where it makes sense to retry a |
@ricellis , that was just an example, let me change it to another one like |
Is your feature request related to a problem? Please describe.
My current project was using
nodejs-cloudant
library and since it is deprecated I'm shifting toIBM cloudant-node-sdk
. I was using some of the plugins from the library and one of it isretry
. Currently I do not see any retry mechanism in the new SDK.Describe the solution you'd like
Like in previous library where there was support for retry mechanism using a plugin, it would be better if we have similar retry mechanism in this SDK.
The text was updated successfully, but these errors were encountered: