TsgcWSPClient_MQTT | MQTT Receive Messages

Messages sent by server, are received OnMQTTPublish event. This event has the following parameters:

 

Topic: is the name of the topic associated to this message.

Text: is the text of the message.

PublishProperties: if MQTT 5.0, these are the properties of the published message.

 

Read published Messages


procedure OnMQTTPublish(Connection: TsgcWSConnection; aTopic, aText: string; 
  PublishProperties: TsgcWSMQTTPublishProperties);
begin
  WriteLn('Topic: ' + aTopic + '. Message: ' + aText);
end;