TsgcWSPClient_MQTT › Events › OnMQTTPubComp
Fires on the fourth and final leg of the QoS 2 handshake when a PUBCOMP is received.
property OnMQTTPubComp: TsgcWSMQTTPubCompEvent;
// TsgcWSMQTTPubCompEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubCompProperties: TsgcWSMQTTPUBCOMPProperties) of object
—
Fires when the broker sends PUBCOMP, the fourth and final packet of the QoS 2 handshake (PUBLISH → PUBREC → PUBREL → PUBCOMP). At this point the exactly-once delivery is fully complete and the packet identifier can be reused. Parameters:
This is the event to listen to when you need to confirm that a QoS 2 publish has been fully processed end-to-end.
procedure TForm1.MQTTPubComp(Connection: TsgcWSConnection;
aPacketIdentifier: Word; ReasonCode: Integer;
const ReasonName: String;
PubCompProperties: TsgcWSMQTTPUBCOMPProperties);
begin
// QoS 2 delivery is now complete
Memo1.Lines.Add(Format('PUBCOMP id=%d delivered exactly-once',
[aPacketIdentifier]));
end;