• Version 3.222.0
  • Published
  • 66.9 kB
  • 6 dependencies
  • Apache-2.0 license


npm i @aws-sdk/middleware-retry
yarn add @aws-sdk/middleware-retry
pnpm add @aws-sdk/middleware-retry


[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-retry/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-retry) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-retry.svg)](https://www.npmjs.com/package/@aws




const CONFIG_MAX_ATTEMPTS: string;

    variable CONFIG_RETRY_MODE

    const CONFIG_RETRY_MODE: string;


      const DEFAULT_MAX_ATTEMPTS: number;
      • The default value for how many HTTP requests an SDK should make for a single SDK operation invocation before giving up

      variable DEFAULT_RETRY_MODE

      const DEFAULT_RETRY_MODE: string;
      • The default retry algorithm to use.

      variable ENV_MAX_ATTEMPTS

      const ENV_MAX_ATTEMPTS: string;

        variable ENV_RETRY_MODE

        const ENV_RETRY_MODE: string;


          const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors<number>;


            const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<string>;

              variable omitRetryHeadersMiddlewareOptions

              const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions;

                variable retryMiddlewareOptions

                const retryMiddlewareOptions: any;


                  function defaultDelayDecider

                  defaultDelayDecider: (delayBase: number, attempts: number) => number;
                  • Calculate a capped, fully-jittered exponential backoff time.

                  function defaultRetryDecider

                  defaultRetryDecider: (error: SdkError) => boolean;

                    function getOmitRetryHeadersPlugin

                    getOmitRetryHeadersPlugin: (options: unknown) => Pluggable<any, any>;

                      function getRetryPlugin

                      getRetryPlugin: (options: RetryResolvedConfig) => Pluggable<any, any>;

                        function omitRetryHeadersMiddleware

                        omitRetryHeadersMiddleware: () => <
                        Output extends MetadataBearer = MetadataBearer
                        next: FinalizeHandler<any, Output>
                        ) => FinalizeHandler<any, Output>;

                          function resolveRetryConfig

                          resolveRetryConfig: <T>(
                          input: T & PreviouslyResolved & RetryInputConfig
                          ) => T & RetryResolvedConfig;

                            function retryMiddleware

                            retryMiddleware: (
                            options: RetryResolvedConfig
                            ) => <Output extends MetadataBearer = MetadataBearer>(
                            next: FinalizeHandler<any, Output>,
                            context: HandlerExecutionContext
                            ) => FinalizeHandler<any, Output>;


                              class AdaptiveRetryStrategy

                              class AdaptiveRetryStrategy extends StandardRetryStrategy {}


                                maxAttemptsProvider: Provider<number>,
                                options?: AdaptiveRetryStrategyOptions

                                  method retry

                                  retry: <Input extends object, Ouput extends MetadataBearer>(
                                  next: FinalizeHandler<Input, Ouput>,
                                  args: FinalizeHandlerArguments<Input>
                                  ) => Promise<{ response: unknown; output: Ouput }>;

                                    class DefaultRateLimiter

                                    class DefaultRateLimiter implements RateLimiter {}


                                      constructor(options?: DefaultRateLimiterOptions);

                                        method getSendToken

                                        getSendToken: () => Promise<void>;

                                          method updateClientSendingRate

                                          updateClientSendingRate: (response: any) => void;

                                            class StandardRetryStrategy

                                            class StandardRetryStrategy implements RetryStrategy {}


                                              maxAttemptsProvider: Provider<number>,
                                              options?: StandardRetryStrategyOptions

                                                property mode

                                                mode: string;

                                                  method retry

                                                  retry: <Input extends object, Ouput extends MetadataBearer>(
                                                  next: FinalizeHandler<Input, Ouput>,
                                                  args: FinalizeHandlerArguments<Input>,
                                                  options?: { beforeRequest: Function; afterRequest: Function }
                                                  ) => Promise<{ response: unknown; output: Ouput }>;


                                                    interface AdaptiveRetryStrategyOptions

                                                    interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptions {}
                                                    • Strategy options to be passed to AdaptiveRetryStrategy

                                                    property rateLimiter

                                                    rateLimiter?: RateLimiter;

                                                      interface DefaultRateLimiterOptions

                                                      interface DefaultRateLimiterOptions {}

                                                        property beta

                                                        beta?: number;

                                                          property minCapacity

                                                          minCapacity?: number;

                                                            property minFillRate

                                                            minFillRate?: number;

                                                              property scaleConstant

                                                              scaleConstant?: number;

                                                                property smooth

                                                                smooth?: number;

                                                                  interface DelayDecider

                                                                  interface DelayDecider {}
                                                                  • Determines the number of milliseconds to wait before retrying an action.

                                                                    Parameter delayBase

                                                                    The base delay (in milliseconds).

                                                                    Parameter attempts

                                                                    The number of times the action has already been tried.

                                                                  call signature

                                                                  (delayBase: number, attempts: number): number;

                                                                    interface RateLimiter

                                                                    interface RateLimiter {}

                                                                      property getSendToken

                                                                      getSendToken: () => Promise<void>;
                                                                      • If there is sufficient capacity (tokens) available, it immediately returns. If there is not sufficient capacity, it will either sleep a certain amount of time until the rate limiter can retrieve a token from its token bucket or raise an exception indicating there is insufficient capacity.

                                                                      property updateClientSendingRate

                                                                      updateClientSendingRate: (response: any) => void;
                                                                      • Updates the client sending rate based on response. If the response was successful, the capacity and fill rate are increased. If the response was a throttling response, the capacity and fill rate are decreased. Transient errors do not affect the rate limiter.

                                                                      interface RetryDecider

                                                                      interface RetryDecider {}
                                                                      • Determines whether an error is retryable based on the number of retries already attempted, the HTTP status code, and the error received (if any).

                                                                        Parameter error

                                                                        The error encountered.

                                                                      call signature

                                                                      (error: SdkError): boolean;

                                                                        interface RetryInputConfig

                                                                        interface RetryInputConfig {}

                                                                          property maxAttempts

                                                                          maxAttempts?: number | Provider<number>;
                                                                          • The maximum number of times requests that encounter retryable failures should be attempted.

                                                                          property retryStrategy

                                                                          retryStrategy?: RetryStrategy;
                                                                          • The strategy to retry the request. Using built-in exponential backoff strategy by default.

                                                                          interface RetryQuota

                                                                          interface RetryQuota {}
                                                                          • Interface that specifies the retry quota behavior.

                                                                          property hasRetryTokens

                                                                          hasRetryTokens: (error: SdkError) => boolean;
                                                                          • returns true if retry tokens are available from the retry quota bucket.

                                                                          property releaseRetryTokens

                                                                          releaseRetryTokens: (releaseCapacityAmount?: number) => void;
                                                                          • releases tokens back to the retry quota.

                                                                          property retrieveRetryTokens

                                                                          retrieveRetryTokens: (error: SdkError) => number;
                                                                          • returns token amount from the retry quota bucket. throws error is retry tokens are not available.

                                                                          interface RetryResolvedConfig

                                                                          interface RetryResolvedConfig {}

                                                                            property maxAttempts

                                                                            maxAttempts: Provider<number>;

                                                                            property retryStrategy

                                                                            retryStrategy: Provider<RetryStrategy>;

                                                                            interface StandardRetryStrategyOptions

                                                                            interface StandardRetryStrategyOptions {}
                                                                            • Strategy options to be passed to StandardRetryStrategy

                                                                            property delayDecider

                                                                            delayDecider?: DelayDecider;

                                                                              property retryDecider

                                                                              retryDecider?: RetryDecider;

                                                                                property retryQuota

                                                                                retryQuota?: RetryQuota;


                                                                                  enum RETRY_MODES

                                                                                  enum RETRY_MODES {
                                                                                  STANDARD = 'standard',
                                                                                  ADAPTIVE = 'adaptive',

                                                                                    member ADAPTIVE

                                                                                    ADAPTIVE = 'adaptive'

                                                                                      member STANDARD

                                                                                      STANDARD = 'standard'

                                                                                        Package Files (11)

                                                                                        Dependencies (6)

                                                                                        Dev Dependencies (8)

                                                                                        Peer Dependencies (0)

                                                                                        No peer dependencies.


                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-sdk/middleware-retry.

                                                                                        • Markdown
                                                                                        • HTML
                                                                                          <a href="https://www.jsdocs.io/package/@aws-sdk/middleware-retry"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>