GuidesMQTT Fundamentals
MQTT fundamentals
Learn the core concepts of MQTT messaging that power CloudSignal.
MQTT is a lightweight publish-subscribe messaging protocol designed for constrained devices and unreliable networks. Read this section if you're new to MQTT and want to understand how topics, QoS, and retained messages shape what CloudSignal can do for you.
Core concepts
Publish-subscribe pattern
Unlike request-response APIs, MQTT uses publish-subscribe:
| Pattern | Flow |
|---|---|
| Traditional API | Client sends request to server, server sends response back to client |
| MQTT | Publisher sends to a topic, broker routes to all matching subscribers, no direct client-to-client connection |
Key components
| Component | Description |
|---|---|
| Broker | CloudSignal's server that routes messages |
| Client | Any application or service connecting to the broker |
| Topic | Named channel for messages (for example, agents/agent-001/state) |
| Message | Data payload sent to a topic |
| QoS | Quality of service, delivery guarantees |
Message flow
Message flow
Agent publishes
agents/agent-001/state
PUBLISH
Broker receives
Route
Deliver to subscribers
Why MQTT?
| Feature | Benefit |
|---|---|
| Lightweight | Minimal bandwidth, works on slow connections |
| Persistent sessions | Messages delivered even after reconnection |
| Retained messages | New subscribers get the last value immediately |
| QoS levels | Choose delivery guarantees per message |
| Last will | Notify others when a client disconnects unexpectedly |
Guides
Topics & wildcards
How to structure and subscribe to MQTT topics
QoS levels
Understanding delivery guarantees: 0, 1, and 2
Retained messages
Persist the last message on a topic for new subscribers
CloudSignal + MQTT
CloudSignal extends standard MQTT with:
| Feature | Description |
|---|---|
| Organization isolation | Your data is separate from other customers |
| Token-based auth | Temporary credentials for untrusted clients |
| Dashboard management | Create users, ACLs, and monitor sessions |
| Persistent sessions | Your session state survives reconnections |
| Message retention | Store messages for up to 30 days |
Quick reference
Connect: mqtts://mqtt.cloudsignal.app:8883
Username: your-user@your-org-id
Topics: any/topic/you/want
QoS: 0, 1, or 2Start with Topics & wildcards to understand MQTT's addressing system.