SDK / Python Storage Communication Service Analytics Eye Tracker C# / Python Digital Twin Web / Java Dashboard Goal: components agree on messages, not implementation language. 2
PUBLISH Dashboard MQTT Broker Storage Topic: lab/eeg/participant-872/metrics Analytics Payload: { "focus": 0.72, "stress": 0.31, "ts": "…" } Publisher does not need to know who consumes the message. 4
TOPIC BROKER Connects, publishes, subscribes Logical address for messages Routes messages to subscribers Decoupling dimensions A Python sensor and a Java dashboard can cooperate without importing each other’s code. CSC 364 or equivalent 7
• A set of MQTT client libr ries developed by the Eclipse Found tion. • It supports multiple l ngu ges, such s J v , Python, J v Script, etc. J v Dependency (M ven) a a a a a a a a a a a a a 10 a <dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId> <version>1.2.5</version> </dependency>
This option is suitable when message loss is acceptable, as it doesn't require acknowledgment or persistence. • 1 – "at least once": This option should be chosen when message loss is unacceptable, and your subscribers can handle duplicate messages. • 2 – "Exactly once": This option is ideal when message loss is unacceptable, and your subscribers cannot handle duplicate messages. 12
Fast telemetry; occasional loss may be acceptable QoS 1 “At least once” Acknowledged delivery; duplicates are possible AWS IoT Core supports QoS 0 and QoS 1 (not QoS 2). Therefore consumers should be prepared for duplicate messages when correctness matters. Example: pose stream → QoS 0 | critical command / event → consider QoS 1 15
Device reported state update Device Shadow Cloud copy of state set desired desired Application desired state reported Useful when the device is temporarily offline or when apps need the latest known state. Event stream ≠ state store
What can each client publish or subscribe to? Thing / Client X.509 Certificate Example principle of least privilege Robot adapter: publish 5100/robot/ur3e-01/pose subscribe 5100/commands/ur3e-01/# IoT Policy Topics
/ MQTT Shared asynchronous event bus Message format JSON initially Language-neutral and inspectable Topic namespace 5100/<domain>/<device>/<event> Stable architectural contract Telemetry QoS 0 by default Favor freshness / throughput Important events QoS 1 + message ID Handle duplicates explicitly State Device Shadow when appropriate Latest desired/reported device state Persistence Rules → AWS service Separate transport from storage
2026 Copyright. These slides may be used only as study material for CSC 5100 within the California State University system. They may not be distributed or used for any other purpose.