Skip to content

Add MQTT read-only adapter foundation#227

Merged
smithaldon1 merged 1 commit into
mainfrom
feat/issue-213-mqtt-read-only-adapter
May 25, 2026
Merged

Add MQTT read-only adapter foundation#227
smithaldon1 merged 1 commit into
mainfrom
feat/issue-213-mqtt-read-only-adapter

Conversation

@smithaldon1
Copy link
Copy Markdown
Member

Closes #213

Summary

  • Add an ingestion-layer MQTT read-only adapter foundation that loads enabled MQTT ProtocolConnectionProfile records from the local profile store.
  • Consume configured topic filters through an injectable MqttMessageSource; no command publishing, writeback, arbitrary topic discovery, or broker runtime is added.
  • Support broker URL, client ID, topic filters, QoS, TLS flag, and auth/certificate references through the existing profile contract passed to the message source.
  • Normalize Sparkplug-style JSON demo payload metrics into process.measurement.recorded FactoryEvents with source metadata for connection profile ID, topic, metric name, adapter name, and poll index.
  • Add clear adapter errors for invalid profile stores, unavailable brokers, malformed payloads, and unmapped topics.

Test Evidence

  • .venv/bin/python -m pytest services/ingestion/tests/test_mqtt_read_only_adapter.py - passed, 11 tests.
  • make test-integration - passed, 85 tests.
  • make lint - passed, Ruff found no issues after import formatting and line wrapping.
  • make typecheck - passed, compileall completed across packages and services.
  • make test - passed, 257 tests.
  • make docs - passed; docs are Markdown-only and no checker is configured yet.
  • git diff --check and git diff --cached --check - passed.

Docs Impact

  • Updated services/ingestion/README.md with the MQTT read-only adapter foundation, Sparkplug-style JSON payload shape, source metadata behavior, safety boundary, and focused test command.
  • Updated docs/LEARNING_LOG.md with what changed, why it matters, how the data flows, how to test it, and the next learning step.

Follow-up Work

  • Add a real broker-backed message source once connector runtime orchestration and secret resolution are defined.
  • Add explicit tag/source mapping lookup so payload mappings can be governed by mapping_reference instead of adapter defaults and payload context.
  • Keep publish commands, writeback, arbitrary topic discovery, and UI ingestion controls out of this adapter until dedicated issues and ADR updates define those boundaries.

Copy link
Copy Markdown
Member Author

@smithaldon1 smithaldon1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved for merge

@smithaldon1 smithaldon1 merged commit 5788e7e into main May 25, 2026
3 checks passed
@smithaldon1 smithaldon1 deleted the feat/issue-213-mqtt-read-only-adapter branch May 25, 2026 15:28
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.

8. Feature: Add MQTT read-only adapter foundation

1 participant