Skip to content

Commit 35a1da0

Browse files
committed
move publish acknowledgement to an advanced operations section
1 parent e04ccd6 commit 35a1da0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

documents/MQTT5_Userguide.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
- [Subscribe](#subscribe)
2525
- [Unsubscribe](#unsubscribe)
2626
- [Publish](#publish)
27-
- [Manual Publish Acknowledgement](#manual-publish-acknowledgement)
27+
* [Advanced Operations and Settings](#advanced-operations-and-settings)
28+
+ [Manual Publish Acknowledgement](#manual-publish-acknowledgement)
2829
* [MQTT5 Best Practices](#mqtt5-best-practices)
2930

3031
# Introduction
@@ -758,9 +759,11 @@ If the PUBLISH was a QoS 1 publish, then the completion callback returns a PubAc
758759
```
759760
760761
761-
### Manual Publish Acknowledgement
762+
# Advanced Operations and Settings
762763
763-
By default, the MQTT5 client automatically sends a PUBACK for every QoS 1 PUBLISH it receives, immediately after the `OnPublishReceivedHandler` callback returns. Manual publish acknowledgement gives you control over when that PUBACK is sent, allowing you to defer acknowledgement until after your application has fully processed the message. For example; after persisting it to a database or forwarding it to another service.
764+
## Manual Publish Acknowledgement
765+
766+
By default, the MQTT5 client automatically sends a PUBACK for every QoS 1 PUBLISH it receives, immediately after the `OnPublishReceivedHandler` callback returns. Manual publish acknowledgement gives you control over when that PUBACK is sent, allowing you to defer acknowledgement until after your application has fully processed the message — for example, after persisting it to a database or forwarding it to another service.
764767
765768
To take manual control of the PUBACK, call `eventData.acquirePublishAcknowledgement()` **within** the `OnPublishReceivedHandler` callback. This returns a `ScopedResource<PublishAcknowledgementHandle>` that you can store and use later to send the PUBACK by calling `client->InvokePublishAcknowledgement()`.
766769

0 commit comments

Comments
 (0)