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
Copy file name to clipboardExpand all lines: doc/dev/adr/0020-large-message-chunking.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ We will implement sdk-level message chunking as part of the MQTT layer by using
12
12
The chunking mechanism will:
13
13
1. Be applied only to MQTT PUBLISH packets
14
14
2. Use standardized user properties for chunk metadata:
15
-
-`__chunk`: `mid:<original message id>;ci:<chunk index>;tc:<total chunk count>;cs:<full message check sum>`; `mid,ci` - present for every chunk; `tc,cs` - present only for the first chunk.
15
+
-`__chunk`: `<original message id>;<chunk index>;<total chunk count>;<full message check sum>`; `<original message id>,<chunk index>` - present for every chunk; `<total chunk count>,<full message check sum>` - present only for the first chunk.
16
16
17
17
### Protocol Flow
18
18
**Sending Process:**
@@ -24,22 +24,21 @@ The chunking mechanism will:
24
24
25
25
**Receiving Process:**
26
26
- The MQTT client receives messages and identifies chunked messages by the presence of chunk metadata.
27
-
- Chunks are stored in a temporary buffer, indexed by message ID (`__mid`) and chunk index (`__ci`).
28
-
- When all chunks for a message ID are received, they are reassembled in order.
27
+
- Chunks are stored in a temporary buffer, indexed by message ID and chunk index.
28
+
- When all chunks for a message ID are received, they are reassembled in order and message checksum verified.
29
29
- The reconstructed message is then processed as a single message by the application callback.
30
30
31
31
## Consequences
32
32
33
33
### Benefits
34
34
-**Standards-Based:** Uses existing MQTT features rather than custom transport mechanisms
35
-
-**Protocol Transparent:** Makes chunking behavior explicit in the protocol
35
+
-**Protocol Transparent:** Makes chunking behavior explicit in the MQTT protocol
36
36
-**Property Preservation:** Maintains topic, QoS, and other message properties consistently
37
37
-**Network Optimized:** Allows efficient transmission of large payloads over constrained networks
38
38
39
39
### Implementation Considerations
40
40
-**Error Handling:**
41
41
- Chunk timeout mechanisms
42
-
- Missing chunk detection
43
42
- Error propagation to application code
44
43
-**Performance Optimization:**
45
44
- Dynamic chunk sizing based on broker limitations
@@ -52,3 +51,4 @@ The chunking mechanism will:
52
51
## Open Questions
53
52
1. How do we determine the optimal chunk size? Should it be based on the broker's max size, network conditions, or configurable by the application?
54
53
2. Do we create a new API method (`PublishLargeAsync()`) or use the existing `PublishAsync()` API with transparent chunking for oversized payloads?
54
+
3. Chunking and shared subscriptions: How do we handle chunked messages across multiple subscribers?
0 commit comments