Table of Contents

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

logger ILogger<CloudEventMiddleware>
options IOptions<CloudEventOptions>
bridge IEnvelopeCloudEventBridge
schemaRegistry ISchemaRegistry

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

message IDispatchMessage

The dispatch message being processed.

context IMessageContext

The message context containing metadata.

nextDelegate DispatchRequestDelegate

The next middleware delegate in the pipeline.

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

ValueTask<IMessageResult>

A task representing the message processing result.

Exceptions

InvalidOperationException