AWS IoT Core

Connect Delphi/C++Builder applications to AWS IoT Core over MQTT. Mutual TLS with X.509 certificates or SigV4-signed WebSocket, plus shadow and rule-engine integration.

TsgcIoTAmazon_MQTT_Client

AWS IoT Core MQTT 3.1.1 / MQTT 5 client — X.509 mutual TLS or SigV4-over-WebSocket auth, plus subscriptions, retained messages, will, and the AWS-specific client-id constraints.

Component class

TsgcIoTAmazon_MQTT_Client

Protocol

AWS IoT MQTT

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Set credentials, connect, publish

Set the AWS endpoint host, point the component at your X.509 cert/key (or supply AWS access keys for SigV4), then connect, subscribe and publish like any MQTT client.

uses
  sgcIoT;

var
  AWSIoT: TsgcIoTAmazon_MQTT_Client;
begin
  AWSIoT := TsgcIoTAmazon_MQTT_Client.Create(nil);
  AWSIoT.IoT.Host := 'a1b2c3d4e5f.iot.eu-west-1.amazonaws.com';

  // X.509 mutual TLS
  AWSIoT.IoT.Authentication := iotAuth_Certificate;
  AWSIoT.IoT.Certificate.CertFile := 'device.cert.pem';
  AWSIoT.IoT.Certificate.KeyFile  := 'device.private.key';
  AWSIoT.IoT.Certificate.RootCert := 'AmazonRootCA1.pem';

  AWSIoT.OnMQTTConnect := procedure(Connection: TsgcWSConnection;
    const Session: Boolean; const ReasonCode: Integer;
    const ReasonName: string;
    const ConnectProperties: TsgcWSMQTTCONNACKProperties)
  begin
    AWSIoT.Subscribe('devices/#');
  end;

  AWSIoT.Active := True;
  AWSIoT.Publish('devices/sensor1/telemetry', '{"temp":22.5}');
end;
// uses: sgcIoT
TsgcIoTAmazon_MQTT_Client *AWSIoT = new TsgcIoTAmazon_MQTT_Client(this);
AWSIoT->IoT->Host = "a1b2c3d4e5f.iot.eu-west-1.amazonaws.com";
AWSIoT->IoT->Authentication = iotAuth_Certificate;
AWSIoT->IoT->Certificate->CertFile = "device.cert.pem";
AWSIoT->IoT->Certificate->KeyFile  = "device.private.key";

AWSIoT->Active = true;

What's inside

A pre-configured MQTT client for AWS IoT Core that handles the AWS-specific auth choices and topic conventions.

X.509 mutual TLS

Set IoT.Authentication := iotAuth_Certificate and load the device certificate, private key and AmazonRootCA1.pem — the component uses ALPN x-amzn-mqtt-ca on port 443 if needed.

SigV4 over WebSocket

For browser-style auth set IoT.Authentication := iotAuth_AccessKey and configure access-key / secret-key / region — the component computes the SigV4 query-string presigned URL.

MQTT 3.1.1 + MQTT 5

Toggle MQTTVersion; AWS IoT Core supports both. MQTT 5 properties (session expiry, topic alias, user properties) flow through the standard MQTT events.

AWS topic conventions

AWS reserves topics under $aws/things/<thingName>/... for shadow, jobs and provisioning. Subscribe to them like any other topic to receive shadow updates and job assignments.

Reconnect-safe

Bind WatchDog on the underlying client — on disconnect the component re-authenticates (fresh SigV4 query-string when applicable) and re-subscribes.

Throughput limits

AWS IoT enforces per-connection limits (publish QoS, throughput, message size). Use a TsgcWSRateLimiter on the publish side to stay under the quota.

Specifications & references

Authoritative sources for the protocol this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — TsgcIoTAmazon_MQTT_Client Full property, method and event reference for this component.
Demo Project — Demos\10.IoT_Clients Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Connect Delphi to AWS IoT?

Download the free trial and stream IoT telemetry from Delphi devices to AWS IoT Core.