---
id: "mosquitto"
type: "component"
kind: "pubsub-topic"
provider: "default"
category: "messaging"
docs: "https://mosquitto.org/man/mosquitto-conf-5.html"
url: "https://localhost:3000/catalogue/components/mosquitto"
---

# Eclipse Mosquitto

Lightweight single-process MQTT broker, in-memory unless persistence is turned on.

| | |
|---|---|
| Provider | [default](https://localhost:3000/catalogue?provider=default) |
| Kind | [Pub/Sub topic](https://localhost:3000/catalogue/kinds/pubsub-topic) |
| Category | Messaging |
| Official docs | [https://mosquitto.org/man/mosquitto-conf-5.html](https://mosquitto.org/man/mosquitto-conf-5.html) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `allowAnonymous` | boolean | — | no | false | inherited |
| `delivery` | enum | `at-most-once`, `at-least-once`, `exactly-once` | yes | — | **"at-most-once"** |
| `managed` | boolean | — | no | false | **false** |
| `maxQueuedMessages` | integer | — | no | 1000 | inherited |
| `mqttVersion` | enum | `v3-1`, `v3-1-1`, `v5` | no | "v5" | inherited |
| `ordering` | enum | `none`, `per-key` | no | "none" | **"per-key"** |
| `persistence` | boolean | — | no | false | inherited |
| `replay` | boolean | — | no | false | **false** |
| `topicPerEventType` (advanced) | boolean | — | no | true | inherited |

Bold values are the ones this component pins.

## Rules that apply · 1

### Pub/Sub topic where replay is required `pubsub-replay-required` (error)

- Page: https://localhost:3000/catalogue/rules/pubsub-replay-required.md
- Why: The design declares that consumers must be able to replay history. A fan-out topic that does not retain messages cannot deliver that.
- Applies to: every node of kind pubsub-topic
- Message: Topic '{{node.id}}' cannot replay messages, but the design requires replay. Use a stream or a replayable queue.

It fires when:

- all of these hold:
  - the design requirement `messaging.replay` is true
  - the node's `replay` is false

## Other products of the same kind · 12

- [EventBridge](https://localhost:3000/catalogue/components/alibaba-eventbridge.md) `alibaba-eventbridge` — alibabacloud
- [Amazon EventBridge](https://localhost:3000/catalogue/components/aws-eventbridge.md) `aws-eventbridge` — aws
- [Amazon SNS](https://localhost:3000/catalogue/components/sns.md) `sns` — aws
- [Azure Event Grid](https://localhost:3000/catalogue/components/azure-event-grid.md) `azure-event-grid` — azure
- [Azure Event Grid MQTT Broker](https://localhost:3000/catalogue/components/azure-event-grid-mqtt.md) `azure-event-grid-mqtt` — azure
- [MQTT broker](https://localhost:3000/catalogue/components/mqtt-broker.md) `mqtt-broker` — default
- [NanoMQ](https://localhost:3000/catalogue/components/nanomq.md) `nanomq` — default
- [Generic Pub/Sub topic](https://localhost:3000/catalogue/components/pubsub-topic.md) `pubsub-topic` — default
- [Redis Pub/Sub](https://localhost:3000/catalogue/components/redis-pubsub.md) `redis-pubsub` — default
- [Eventarc](https://localhost:3000/catalogue/components/google-eventarc.md) `google-eventarc` — gcp
- [Google Cloud Pub/Sub](https://localhost:3000/catalogue/components/google-pubsub.md) `google-pubsub` — gcp
- [OCI Events](https://localhost:3000/catalogue/components/oci-events.md) `oci-events` — oci

## Use it in a design

```yaml
nodes:
  - { id: "mosquitto", component: "mosquitto" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Eclipse Mosquitto: single-process MQTT broker. "mosquitto.conf" states persistence defaults to false
# (memory only), max_queued_messages is 1000 per client, allow_anonymous is false once a listener is
# defined, retained messages are supported and listeners accept MQTT 3.1, 3.1.1 and 5 by default.
schemaVersion: "1"
type: "component"
id: "mosquitto"
kind: "pubsub-topic"
provider: "default"
docs: "https://mosquitto.org/man/mosquitto-conf-5.html"
defaults:
  delivery: "at-most-once"
  ordering: "per-key"
  replay: false
  managed: false
properties:
  persistence:
    type: "boolean"
    default: false
  maxQueuedMessages:
    type: "integer"
    default: 1000
  allowAnonymous:
    type: "boolean"
    default: false
  mqttVersion:
    type: "enum"
    values: ["v3-1", "v3-1-1", "v5"]
    default: "v5"
```

Human page: https://localhost:3000/catalogue/components/mosquitto
