Class AsyncApiMockHostingExtension

Namespace
Kuestenlogik.Bowire.AsyncApi
Assembly
Kuestenlogik.Bowire.AsyncApi.dll

AsyncAPI plugin's mock-host extension — the messaging-side sibling of RestMockHostingExtension. Serves the recording's verbatim SourceSchema back under GET /asyncapi.{yaml,yml,json} when the format tag identifies an AsyncAPI document. Lets a peer Bowire workbench point at the mock and discover the full declared topology — channels, operations, bindings — rather than just the topic slice the recording happens to replay.

public sealed class AsyncApiMockHostingExtension : IBowireMockHostingExtension
Inheritance
AsyncApiMockHostingExtension
Implements
Inherited Members

Remarks

The HTTP endpoints are served on the mock-server's HTTP port regardless of what wire the original target spoke (MQTT, NATS, Kafka, &c). The mock already binds an HTTP listener — replay of non-HTTP captures runs through a side-channel inside the same process — so adding two GET routes is essentially free and lets AsyncAPI discovery hit a stable URL even when the wire is over TCP/UDP.

Picked up via assembly-scan (PluginManager.EnumeratePluginServices<IBowireMockHostingExtension>) at mock-server startup — same discovery path as RestMockHostingExtension and the gRPC reflection extension. Recordings without an AsyncAPI source schema (gRPC, OpenAPI, or pre-v1.7 captures) silently no-op.

Constructors

AsyncApiMockHostingExtension()

public AsyncApiMockHostingExtension()

Properties

Id

Stable id, lower-case, matching the protocol the extension belongs to (e.g. "grpc"). Surfaced in logs only — the host never dispatches by id, it always asks each extension in turn.

public string Id { get; }

Property Value

string

Methods

MapEndpoints(IEndpointRouteBuilder, BowireRecording)

Map protocol-specific endpoints. Called inside the mock host's UseEndpoints block, after the recording-replay middleware is mounted. gRPC uses this to map the reflection service so peer workbenches can auto-discover.

public void MapEndpoints(IEndpointRouteBuilder endpoints, BowireRecording recording)

Parameters

endpoints IEndpointRouteBuilder
recording BowireRecording