You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MQTT is a stateless publish/subscribe protocol without distributed transaction support. The connector provides **at-least-once** delivery semantics by relying on SeaTunnel's source-replay mechanics and MQTT QoS 1.
17
+
**Delivery Semantics Notice**:
18
+
This connector provides **at-most-once** delivery when QoS=0, and **best-effort at-least-once** when QoS=1.
19
+
Due to `clean_session=true` (the default, required for stateless operation), unacknowledged messages may be lost during
or enabling source replay capabilities in SeaTunnel.
18
22
19
23
## Supported Engines
20
24
@@ -32,8 +36,11 @@ MQTT is a stateless publish/subscribe protocol without distributed transaction s
32
36
| password | string | no | - |
33
37
| qos | int | no | 1 |
34
38
| format | string | no | json |
39
+
| field_delimiter | string | no | , |
40
+
| batch_size | int | no | 1 |
35
41
| retry_timeout | int | no | 5000 |
36
42
| connection_timeout | int | no | 30 |
43
+
| clean_session | boolean | no | true |
37
44
| common-options || no | - |
38
45
39
46
### url [string]
@@ -68,7 +75,19 @@ The MQTT Quality of Service level for published messages.
68
75
The serialization format for outgoing messages. Supported values:
69
76
70
77
-`json` — Serialize each row as a JSON object (default)
71
-
-`text` — Serialize each row as comma-delimited plain text
78
+
-`text` — Serialize each row as delimited plain text (delimiter controlled by `field_delimiter`)
79
+
80
+
### field_delimiter [string]
81
+
82
+
The field delimiter used when `format` is set to `text`. Default is `,`.
83
+
84
+
Examples: `,`, `|`, `\t`
85
+
86
+
### batch_size [int]
87
+
88
+
Number of messages to buffer before sending to the broker. Default is `1` (send each message immediately).
89
+
90
+
Higher values improve throughput by reducing per-message overhead. Buffered messages are automatically flushed at each checkpoint and when the writer closes.
72
91
73
92
### retry_timeout [int]
74
93
@@ -78,10 +97,31 @@ Maximum time in milliseconds to retry publishing on transient network failures b
78
97
79
98
The MQTT connection establishment timeout in seconds.
80
99
100
+
### clean_session [boolean]
101
+
102
+
Whether to use a clean MQTT session. Default is `true`.
103
+
104
+
-`true` — Broker discards any previous session state. Suitable for stateless operation (recommended for most use cases).
105
+
-`false` — Broker retains session state (subscriptions, unacknowledged QoS 1 messages). Enables stronger at-least-once guarantees but may cause broker-side state accumulation. Requires stable, unique `clientId` per writer.
106
+
81
107
### common options
82
108
83
109
Sink plugin common parameters, please refer to [Sink Common Options](../common-options/sink-common-options.md) for details.
84
110
111
+
## Performance Considerations
112
+
113
+
The MQTT Sink sends messages synchronously to guarantee delivery ordering. Typical throughput:
Copy file name to clipboardExpand all lines: seatunnel-connectors-v2/connector-mqtt/src/main/java/org/apache/seatunnel/connectors/seatunnel/mqtt/sink/MqttSinkFactory.java
0 commit comments