Interface IAsyncApiBindingResolver
- Namespace
- Kuestenlogik.Bowire.AsyncApi
- Assembly
- Kuestenlogik.Bowire.AsyncApi.dll
Per-wire binding resolver. One implementation per AsyncAPI binding spec (mqtt, kafka, ws, amqp, …) — translates the binding-specific fields (topic, qos, retain, partition-key, subprotocol, …) and the AsyncAPI channel/operation pair into the corresponding wire-plugin call.
Resolvers are lookups from IBowireProtocol.Id, so the AsyncAPI
loader can:
- Parse the channel's
bindings:block, - Pick the resolver whose BindingId matches the binding key,
- Ask the resolver to materialise an invocation against the
corresponding wire plugin (looked up through
BowireProtocolRegistry).
Phase A only ships the MQTT resolver. Phase B adds Kafka + WebSocket. Phase C the remaining bindings whose wire plugins also need to land.
public interface IAsyncApiBindingResolver
Properties
BindingId
AsyncAPI binding key — "mqtt", "kafka", "ws", "amqp", "nats", … —
as it appears under operations.<name>.bindings.<key>
in the document. Matches Id by
convention so the resolver and the wire plugin pair up by id.
string BindingId { get; }
Property Value
Methods
BuildMethod(AsyncApiChannelContext)
Build a BowireMethodInfo from an AsyncAPI operation + channel + the parsed binding block. The returned method is wired onto the service that represents the channel; invocations on that method run through InvokeAsync(AsyncApiChannelContext, List<string>, Dictionary<string, string>?, CancellationToken) below.
BowireMethodInfo BuildMethod(AsyncApiChannelContext channel)
Parameters
channelAsyncApiChannelContext
Returns
InvokeAsync(AsyncApiChannelContext, List<string>, Dictionary<string, string>?, CancellationToken)
Dispatch a discovered AsyncAPI method to its wire plugin.
Implementation looks up the wire plugin via
BowireProtocolRegistry, maps the AsyncAPI channel + binding
fields onto the wire plugin's invocation contract (e.g. MQTT
publish topic + qos), and forwards the JSON payloads.
Task<InvokeResult> InvokeAsync(AsyncApiChannelContext channel, List<string> jsonMessages, Dictionary<string, string>? metadata, CancellationToken ct)
Parameters
channelAsyncApiChannelContextjsonMessagesList<string>metadataDictionary<string, string>ctCancellationToken