Class BowireAsyncApiProtocol
- Namespace
- Kuestenlogik.Bowire.AsyncApi
- Assembly
- Kuestenlogik.Bowire.AsyncApi.dll
AsyncAPI as a Bowire discovery source. Implements IBowireProtocol
so it slots into the existing assembly-scanned registry, URL-hint routing
(asyncapi@./doc.yaml), and recording/mock plumbing — but it does not
own a wire. DiscoverAsync(string, bool, CancellationToken) parses an AsyncAPI document and
turns its channels into BowireServiceInfo nodes; the actual
publish/subscribe calls in InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) are routed to the
matching wire plugin (MQTT, Kafka, WebSocket, …) at runtime via
BowireProtocolRegistry.
Phase A2: the loader is wired up — DiscoverAsync(string, bool, CancellationToken) reads an
AsyncAPI 3.0 document, walks its channels, and emits one
BowireServiceInfo per channel. The binding-translator layer
(which routes invocations to MQTT / Kafka / WebSocket via
BowireProtocolRegistry) lands in Phase A3 — until then,
InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) still raises NotSupportedException.
AsyncAPI 2.x parsing is supported by the SDK reader but not yet mapped
here; only V3 documents produce services.
public sealed class BowireAsyncApiProtocol : IBowireProtocol
- Inheritance
-
BowireAsyncApiProtocol
- Implements
- Inherited Members
Constructors
BowireAsyncApiProtocol()
public BowireAsyncApiProtocol()
Properties
Description
One-line description shown next to the plugin's display name
in Settings → Plugins. Optional; defaults to empty so
the row falls back to "DisplayName + version" without the
description line. Keep it short (≤ 100 characters) — the row
truncates anything wider than the manage panel.
public string Description { get; }
Property Value
IconSvg
SVG icon for the protocol tab.
public string IconSvg { get; }
Property Value
Id
Short identifier (e.g., "grpc", "signalr").
public string Id { get; }
Property Value
Name
Protocol name shown in UI tabs.
public string Name { get; }
Property Value
Methods
DiscoverAsync(string, bool, CancellationToken)
Discover available services and methods.
public Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolctCancellationToken
Returns
Initialize(IServiceProvider?)
Hook the AsyncAPI protocol into the host's BowireProtocolRegistry. We need the registry to dispatch invocations to wire plugins (MQTT, Kafka, …); without it the plugin still loads documents and renders services, but InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) can't route anywhere.
Called by MapBowire() and WithMcpAdapter() on every
IBowireProtocol after discovery scans pick it up. Standalone CLI
passes its own ServiceProvider too.
public void Initialize(IServiceProvider? serviceProvider)
Parameters
serviceProviderIServiceProvider
InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a unary or client-streaming call.
public Task<InvokeResult> InvokeAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a server-streaming or duplex call.
public IAsyncEnumerable<string> InvokeStreamAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)
Open an interactive channel (for duplex/client-streaming).
public Task<IBowireChannel?> OpenChannelAsync(string serverUrl, string service, string method, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringshowInternalServicesboolmetadataDictionary<string, string>ctCancellationToken