Class CloudEventMiddleware
- Namespace
- Excalibur.Dispatch.CloudEvents
- Assembly
- Excalibur.Dispatch.dll
Middleware that handles CloudEvent processing in the Dispatch pipeline. Provides automatic conversion between CloudEvents and Dispatch messages.
public sealed class CloudEventMiddleware : IDispatchMiddleware
- Inheritance
-
CloudEventMiddleware
- Implements
- Inherited Members
- Extension Methods
Constructors
CloudEventMiddleware(ILogger<CloudEventMiddleware>, IOptions<CloudEventOptions>, IEnvelopeCloudEventBridge, ISchemaRegistry?)
Middleware that handles CloudEvent processing in the Dispatch pipeline. Provides automatic conversion between CloudEvents and Dispatch messages.
public CloudEventMiddleware(ILogger<CloudEventMiddleware> logger, IOptions<CloudEventOptions> options, IEnvelopeCloudEventBridge bridge, ISchemaRegistry? schemaRegistry = null)
Parameters
loggerILogger<CloudEventMiddleware>optionsIOptions<CloudEventOptions>bridgeIEnvelopeCloudEventBridgeschemaRegistryISchemaRegistry
Properties
Stage
Gets the pipeline stage where this middleware should be executed.
public DispatchMiddlewareStage? Stage { get; }
Property Value
- DispatchMiddlewareStage?
The current Stage value.
Methods
InvokeAsync(IDispatchMessage, IMessageContext, DispatchRequestDelegate, CancellationToken)
Invokes the CloudEvent middleware to process incoming and outgoing CloudEvents.
public ValueTask<IMessageResult> InvokeAsync(IDispatchMessage message, IMessageContext context, DispatchRequestDelegate nextDelegate, CancellationToken cancellationToken)
Parameters
messageIDispatchMessageThe dispatch message being processed.
contextIMessageContextThe message context containing metadata.
nextDelegateDispatchRequestDelegateThe next middleware delegate in the pipeline.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
- ValueTask<IMessageResult>
A task representing the message processing result.