StellaOps.Workflow.Transport.Http
HTTP transports of the workflow engine: the http kind calls a configured target over HttpClient, and the endpoint kind resolves a service name, method and path to a configured base URL.
| Package | StellaOps.Workflow.Transport.Http |
| Component | Workflow |
| Licence | BUSL-1.1 (Workflow licence) |
| Package kind | Library |
| Target framework | net10.0 |
To add the package to a project, see Installing Stella Ops packages.
Namespaces
| Namespace | Types |
|---|---|
StellaOps.Workflow.Transport.Http | 9 |
StellaOps.Workflow.Transport.Http namespace
| Type | Kind | Description |
|---|---|---|
FailureTranslatingWorkflowEndpointTransport | class | The registered IWorkflowEndpointTransport: WorkflowEndpointTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable service or an open circuit breaker answered as a failed response. |
FailureTranslatingWorkflowHttpTransport | class | The registered IWorkflowHttpTransport: WorkflowHttpTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable target or an open circuit breaker answered as a failed response. |
HttpWorkflowTransportRoutine | class | Dependency-injection routine of the Http transport. |
WorkflowEndpointTransport | class | Calls the HTTP endpoint of a named service ("$type": "endpoint"). |
WorkflowEndpointTransportOptions | class | Base addresses of the services that endpoint calls name, bound from WorkflowEndpointTransportOptions.SectionName: WorkflowEndpointTransport:Services:<service name>:Url, with optional headers per service. |
WorkflowHttpTargetOptions | class | One HTTP target or service: its base URL and the headers every call sends. |
WorkflowHttpTransport | class | No description. |
WorkflowHttpTransportOptions | class | Targets and retries of http calls (WorkflowHttpTransport): WorkflowHttpTransport:Targets:<target>:Url, with optional headers per target. |
WorkflowHttpTransportServiceCollectionExtensions | class | Registers the HTTP and endpoint transports of the Workflow engine. |
FailureTranslatingWorkflowEndpointTransport class
public sealed class FailureTranslatingWorkflowEndpointTransport : IWorkflowEndpointTransport
The registered IWorkflowEndpointTransport: WorkflowEndpointTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable service or an open circuit breaker answered as a failed response.
FailureTranslatingWorkflowEndpointTransport(WorkflowEndpointTransport, ILogger<FailureTranslatingWorkflowEndpointTransport>) constructor
public FailureTranslatingWorkflowEndpointTransport(WorkflowEndpointTransport inner, ILogger<FailureTranslatingWorkflowEndpointTransport> logger)
The registered IWorkflowEndpointTransport: WorkflowEndpointTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable service or an open circuit breaker answered as a failed response.
ExecuteAsync(WorkflowEndpointRequest, CancellationToken) method
public Task<WorkflowEndpointResponse> ExecuteAsync(WorkflowEndpointRequest request, CancellationToken cancellationToken = default)
Sends the request and returns the response. A failure, such as a non-success status or a target that is not configured, is a response that did not succeed; a call that does not answer in time raises a TimeoutException.
Parameters
request: The endpoint request.cancellationToken: Cancels the operation.
Returns
The response.
FailureTranslatingWorkflowHttpTransport class
public sealed class FailureTranslatingWorkflowHttpTransport : IWorkflowHttpTransport
The registered IWorkflowHttpTransport: WorkflowHttpTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable target or an open circuit breaker answered as a failed response.
FailureTranslatingWorkflowHttpTransport(WorkflowHttpTransport, ILogger<FailureTranslatingWorkflowHttpTransport>) constructor
public FailureTranslatingWorkflowHttpTransport(WorkflowHttpTransport inner, ILogger<FailureTranslatingWorkflowHttpTransport> logger)
The registered IWorkflowHttpTransport: WorkflowHttpTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable target or an open circuit breaker answered as a failed response.
ExecuteAsync(WorkflowHttpRequest, CancellationToken) method
public Task<WorkflowHttpResponse> ExecuteAsync(WorkflowHttpRequest request, CancellationToken cancellationToken = default)
Sends the request and returns the response. A failure, such as a non-success status or a target that is not configured, is a response that did not succeed; a call that does not answer in time raises a TimeoutException.
Parameters
request: The HTTP request.cancellationToken: Cancels the operation.
Returns
The response.
HttpWorkflowTransportRoutine class
public sealed class HttpWorkflowTransportRoutine : IDependencyInjectionRoutine
Dependency-injection routine of the Http transport. A host that loads this assembly as a plug-in discovers the routine; it registers exactly what WorkflowHttpTransportServiceCollectionExtensions.AddWorkflowHttpTransport(IServiceCollection, IConfiguration)registers.
HttpWorkflowTransportRoutine() constructor
public HttpWorkflowTransportRoutine()
Creates an instance of HttpWorkflowTransportRoutine.
Register(IServiceCollection, IConfiguration) method
public IServiceCollection Register(IServiceCollection services, IConfiguration configuration)
Registers what WorkflowHttpTransportServiceCollectionExtensions.AddWorkflowHttpTransport(IServiceCollection, IConfiguration)registers.
Parameters
services: The service collection.configuration: The host configuration.
Returns
The same service collection.
WorkflowEndpointTransport class
public sealed class WorkflowEndpointTransport : IWorkflowEndpointTransport
Calls the HTTP endpoint of a named service ("$type": "endpoint"). The service name resolves to a base address through WorkflowEndpointTransportOptions.Services; the request goes to that address joined with the path, with the declared method, over the same named HTTP client and resilience pipeline as WorkflowHttpTransport.
WorkflowEndpointTransport(IHttpClientFactory, IOptions<WorkflowEndpointTransportOptions>, ILogger<WorkflowEndpointTransport>) constructor
public WorkflowEndpointTransport(IHttpClientFactory httpClientFactory, IOptions<WorkflowEndpointTransportOptions> options, ILogger<WorkflowEndpointTransport> logger)
Calls the HTTP endpoint of a named service ("$type": "endpoint"). The service name resolves to a base address through WorkflowEndpointTransportOptions.Services; the request goes to that address joined with the path, with the declared method, over the same named HTTP client and resilience pipeline as WorkflowHttpTransport.
ExecuteAsync(WorkflowEndpointRequest, CancellationToken) method
public Task<WorkflowEndpointResponse> ExecuteAsync(WorkflowEndpointRequest request, CancellationToken cancellationToken = default)
No description.
WorkflowEndpointTransportOptions class
public sealed class WorkflowEndpointTransportOptions
Base addresses of the services that endpoint calls name, bound from WorkflowEndpointTransportOptions.SectionName: WorkflowEndpointTransport:Services:<service name>:Url, with optional headers per service. A call that names a service not listed here is refused.
WorkflowEndpointTransportOptions() constructor
public WorkflowEndpointTransportOptions()
Creates an instance of WorkflowEndpointTransportOptions.
SectionName constant
public const string SectionName = "WorkflowEndpointTransport"
The configuration section the options bind from: WorkflowEndpointTransport.
Services property
public IDictionary<string, WorkflowHttpTargetOptions> Services { get; set; }
The services that endpoint calls name, by name; names compare ignoring case.
WorkflowHttpTargetOptions class
public sealed class WorkflowHttpTargetOptions
One HTTP target or service: its base URL and the headers every call sends.
WorkflowHttpTargetOptions() constructor
public WorkflowHttpTargetOptions()
Creates an instance of WorkflowHttpTargetOptions.
Headers property
public IDictionary<string, string> Headers { get; set; }
Headers sent with every call to the target.
Url property
public string Url { get; set; }
The base URL of the target.
WorkflowHttpTransport class
public sealed class WorkflowHttpTransport : IWorkflowHttpTransport
No description.
WorkflowHttpTransport(IHttpClientFactory, IOptions<WorkflowHttpTransportOptions>, ILogger<WorkflowHttpTransport>) constructor
public WorkflowHttpTransport(IHttpClientFactory httpClientFactory, IOptions<WorkflowHttpTransportOptions> options, ILogger<WorkflowHttpTransport> logger)
No description.
HttpClientName constant
public const string HttpClientName = "workflow-http-transport"
No description.
ExecuteAsync(WorkflowHttpRequest, CancellationToken) method
public Task<WorkflowHttpResponse> ExecuteAsync(WorkflowHttpRequest request, CancellationToken cancellationToken = default)
No description.
WorkflowHttpTransportOptions class
public sealed class WorkflowHttpTransportOptions
Targets and retries of http calls (WorkflowHttpTransport): WorkflowHttpTransport:Targets:<target>:Url, with optional headers per target.
WorkflowHttpTransportOptions() constructor
public WorkflowHttpTransportOptions()
Creates an instance of WorkflowHttpTransportOptions.
SectionName constant
public const string SectionName = "WorkflowHttpTransport"
The configuration section the options bind from: WorkflowHttpTransport.
RetryCount property
public int RetryCount { get; set; }
Retries of a failed attempt in the resilience pipeline. The default is 3.
Targets property
public IDictionary<string, WorkflowHttpTargetOptions> Targets { get; set; }
The targets that http calls name, by name; names compare ignoring case. A call to a target not listed here fails.
TimeoutSeconds property
public int? TimeoutSeconds { get; set; }
Transport-level timeout in seconds for HTTP calls. Null means no transport-level override; per-step timeout or the engine default (1 hour) applies. When set, overrides the per-step default.
WorkflowHttpTransportServiceCollectionExtensions class
public static class WorkflowHttpTransportServiceCollectionExtensions
Registers the HTTP and endpoint transports of the Workflow engine.
AddWorkflowHttpTransport(IServiceCollection, IConfiguration) extension method
public static IServiceCollection AddWorkflowHttpTransport(this IServiceCollection services, IConfiguration configuration)
Registers WorkflowHttpTransportas the IWorkflowHttpTransport, with its named HTTP client and resilience pipeline, from the {WorkflowHttpTransportOptions.SectionName} section.
