IPWorks MQ 2020 Delphi Edition

Questions / Feedback?

IncomingMessages Property

Collection of incoming messages with QoS > 0 that have not been fully acknowledged.

Syntax

property IncomingMessages: TipqMQTTMessageList read get_IncomingMessages;

Remarks

Each time the component receives a message with a QoS of 1 or 2, it adds it to the IncomingMessage* properties. A message remains in the IncomingMessage* properties until the component has completed all of the acknowledgment steps required for it based on its QoS level.

Incoming messages with a QoS of 1 follow these steps:

  1. The message is added to IncomingMessage* when the component receives the PUBLISH packet.
  2. The component sends a PUBACK (publish acknowledgment) packet in response.
  3. The MessageAck event is fired.
  4. The message is removed from IncomingMessage*.
  5. The MessageIn event is fired.

Incoming messages with a QoS of 2 follow these steps:

  1. The message is added to IncomingMessage* when the component receives the PUBLISH packet.
  2. The component sends a PUBREC (publish received) packet in response.
  3. The component waits to receive a PUBREL (publish release) packet.
  4. The component sends a PUBCOMP (publish complete) packet in response.
  5. The MessageAck event is fired.
  6. The message is removed from IncomingMessage*.
  7. The MessageIn event is fired.

The component processes messages anytime DoEvents is called. In applications with a GUI, the DoEvents method is also typically called automatically when the component is idle. In all other situations however, it is best practice to call DoEvents in a loop when possible to ensure timely processing of messages.

Note that incoming messages with a QoS of 0 are not added to IncomingMessage* since they do not require acknowledgment. Upon receipt, they are added to an internal queue, and are fired through the MessageIn event as soon as DoEvents is called.

This property is read-only and not available at design time.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 Delphi Edition - Version 20.0 [Build 8162]