Skip to content

Commit cec5d75

Browse files
progress
1 parent edaa831 commit cec5d75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/dev/adr/0020-large-message-chunking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We will implement sdk-level message chunking as part of the MQTT layer by using
1212
The chunking mechanism will:
1313
1. Be applied only to MQTT PUBLISH packets
1414
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.
1616

1717
### Protocol Flow
1818
**Sending Process:**
@@ -24,22 +24,21 @@ The chunking mechanism will:
2424

2525
**Receiving Process:**
2626
- 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.
2929
- The reconstructed message is then processed as a single message by the application callback.
3030

3131
## Consequences
3232

3333
### Benefits
3434
- **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
3636
- **Property Preservation:** Maintains topic, QoS, and other message properties consistently
3737
- **Network Optimized:** Allows efficient transmission of large payloads over constrained networks
3838

3939
### Implementation Considerations
4040
- **Error Handling:**
4141
- Chunk timeout mechanisms
42-
- Missing chunk detection
4342
- Error propagation to application code
4443
- **Performance Optimization:**
4544
- Dynamic chunk sizing based on broker limitations
@@ -52,3 +51,4 @@ The chunking mechanism will:
5251
## Open Questions
5352
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?
5453
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

Comments
 (0)