Skip to content

MQTT wildcard and prefix fix#2149

Open
Woestebanaan wants to merge 1 commit intolensesio:masterfrom
Woestebanaan:bugfix/issue-1386
Open

MQTT wildcard and prefix fix#2149
Woestebanaan wants to merge 1 commit intolensesio:masterfrom
Woestebanaan:bugfix/issue-1386

Conversation

@Woestebanaan
Copy link
Copy Markdown

Previously, the $ wildcard in KCQL target mappings only worked as a standalone value — getTarget had to return exactly "$" for the MQTT source topic to be used as the target. If a user wrote something like "prefix_$" or "data/$_events", the $ would not be substituted and the literal string (including $) would be used as-is.

This change adds support for $ as an embedded placeholder within a larger target string. The sanitized MQTT topic name is now substituted wherever $ appears in the target.

Examples:

KCQL Target MQTT Topic Before After
$ /sensor/temp sensor_temp sensor_temp
prefix_$ /sensor/temp prefix_$ prefix_sensor_temp
data/$_events /sensor/temp data/$_events data/sensor_temp_events

Also fixed the single and multi-level MQTT wildcards

Resolved the following issue: #1386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants