Class BowireMqttProtocol

Namespace
Kuestenlogik.Bowire.Protocol.Mqtt
Assembly
Kuestenlogik.Bowire.Protocol.Mqtt.dll

Bowire protocol plugin for MQTT 3.1.1 / 5.0 brokers via MQTTnet.

Discovery model:

  • Connects to the broker and subscribes to # (all topics) for a short window, collecting active topic prefixes.
  • Each top-level topic prefix becomes a BowireServiceInfo.
  • Individual sub-topics become methods: Publish (Unary) and Subscribe (ServerStreaming).

Payload handling:

  • Payloads are tried as JSON first, then UTF-8 text, then hex-dumped. This makes the plugin usable for both structured IoT data (JSON) and raw binary payloads.

Auto-discovered by BowireProtocolRegistry.

public sealed class BowireMqttProtocol : IBowireProtocol, IBowireProxySupport
Inheritance
BowireMqttProtocol
Implements
Inherited Members

Constructors

BowireMqttProtocol()

public BowireMqttProtocol()

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

string

DescriptionKey

#691 — optional catalogue key for Description. When the workbench's active locale has an entry for it, that entry is shown; otherwise Description is, exactly as before. Third-party plugins leave it empty and keep today's behaviour.

public string DescriptionKey { get; }

Property Value

string

IconSvg

SVG icon for the protocol tab.

public string IconSvg { get; }

Property Value

string

Id

Short identifier (e.g., "grpc", "signalr").

public string Id { get; }

Property Value

string

Name

Protocol name shown in UI tabs.

public string Name { get; }

Property Value

string

ProxyNote

One sentence on what goes direct and why, for Partial and None.

public string? ProxyNote { get; }

Property Value

string

ProxyNoteKey

The catalogue key for ProxyNote (#691): the workbench shows the translation and falls back to the English note.

public string? ProxyNoteKey { get; }

Property Value

string

ProxySupport

How far this plugin's connections follow the proxy.

public BowireProxySupport ProxySupport { get; }

Property Value

BowireProxySupport

Settings

Settings schema this plugin contributes to the Settings dialog. Each entry becomes a toggle/input in the plugin's section. Default implementation returns empty (no plugin-specific settings).

public IReadOnlyList<BowirePluginSetting> Settings { get; }

Property Value

IReadOnlyList<BowirePluginSetting>

Methods

DiscoverAsync(string, bool, CancellationToken)

Discover available services and methods.

public Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)

Parameters

serverUrl string
showInternalServices bool
ct CancellationToken

Returns

Task<List<BowireServiceInfo>>

Initialize(IServiceProvider?)

Called after registration to inject the app's service provider (embedded mode).

public void Initialize(IServiceProvider? serviceProvider)

Parameters

serviceProvider IServiceProvider

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

serverUrl string
service string
method string
jsonMessages List<string>
showInternalServices bool
metadata Dictionary<string, string>
ct CancellationToken

Returns

Task<InvokeResult>

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

serverUrl string
service string
method string
jsonMessages List<string>
showInternalServices bool
metadata Dictionary<string, string>
ct CancellationToken

Returns

IAsyncEnumerable<string>

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

serverUrl string
service string
method string
showInternalServices bool
metadata Dictionary<string, string>
ct CancellationToken

Returns

Task<IBowireChannel>

ResolveMethodName(string, string)

#664 — discovery names a method by its topic and gives the FullName the route mqtt/<topic>/publish|subscribe; the invoke paths read the topic. Both forms are accepted: the route is reduced to its topic, a topic passes through.

public string ResolveMethodName(string service, string method)

Parameters

service string
method string

Returns

string