SdkOperationExecution
Configure the execution of an operation from Request to Response.
An operation has several "phases" of its lifecycle that can be intercepted and customized. Technically any phase can act on the request or the response. The phases are named with their intended use; however, nothing prevents e.g. registering something in initialize that acts on the output type though.
Middleware Phases
Initialize ---> <Serialize> ---> Mutate
|
v
<Retry>
|
v
+---------------------+
| OnEachAttempt |
| | |
| v |
| <ResolveIdentity> |
| | |
| v |
| <ResolveEndpoint> |
| | |
| v |
| <Signing> |
| | |
| v |
| <Deserialize> |
| | |
| v |
| Receive |
| | |
| v |
| <HttpClient> |
+---------------------+
In the above diagram the phase relationships and sequencing are shown. Requests start at initialize and proceed until the actual HTTP client engine call. The response then is returned up the call stack and traverses the phases in reverse.
Phases enclosed in brackets <>
are implicit phases that are always present and cannot be intercepted directly (only one is allowed to exist). These are usually configured directly when the operation is built.
Default Behaviors
By default, every operation is:
Retried using the configured retryStrategy and retryPolicy.
Signed using the resolved authentication scheme
Properties
The authentication config to use. Defaults to OperationAuthConfig.Anonymous which uses anonymous authentication (no auth).
The endpoint resolver for the operation
Request Middlewares: Prepare the input Request (e.g. set any default parameters if needed) before serialization
Request Middlewares: Modify the outgoing HTTP request. This phase runs BEFORE the retry loop and is suitable for any middleware that only needs to run once and does not need to modify the outgoing request per/attempt.
Request Middlewares: Modify the outgoing HTTP request. This phase is conceptually the same as mutate but it runs on every attempt. Each attempt will not see modifications made by previous attempts.
Request Middlewares: First chance to intercept after signing (and last chance before the final request is sent).
The retry policy to use. Defaults to StandardRetryPolicy.Default
The retry strategy to use. Defaults to StandardRetryStrategy