sgcMQ Feature Matrix: MQTT, AMQP, Kafka, STOMP | eSeGeCe

sgcMQ Feature Matrix

Everything sgcMQ does, mapped across the seven client components and the specifications they implement. Every capability works the same in Delphi and C++ Builder, and every license ships full source code. Click a component for its own page with usage and examples.

MQTT

3.1.1 and 5.0

AMQP

0.9.1 and 1.0

Kafka

Native wire protocol

STOMP

1.0 / 1.1 / 1.2

Transport & TLS

Plain TCP and TLS

Standards & Platforms

Delphi 7 to 13, C++ Builder

sgcMQ is self-contained. It ships with the sgcWebSockets Core runtime bundled in, so it is not an add-on and there is no base license to buy.

Transport: plain TCP and TLS. sgcMQ connects over plain TCP and TLS. If you need to run the protocol over WebSocket, for example MQTT over WebSocket or AMQP over WebSocket, that requires a sgcWebSockets package, which provides the WebSocket client.

Every capability in the tables below is reached over the raw TCP carrier TsgcTCPClient, which sgcMQ ships in the box.

Seven Palette Components

Four protocol families, registered on the SGC MQ palette page.

ComponentClassFamilyDescription
MQTT ClientTsgcWSPClient_MQTTMQTTMQTT 3.1.1 and 5.0 publish/subscribe: QoS 0/1/2, retained messages, Last Will and Testament, sessions and MQTT 5 properties.
AMQP 0.9.1 ClientTsgcWSPClient_AMQPAMQPChannels, exchanges, queues and bindings, consumers, acknowledgements, prefetch QoS and transactions.
AMQP 1.0 ClientTsgcWSPClient_AMQP1AMQPSessions, sender and receiver links, credit-based flow control, SASL authentication and Azure CBS token helpers.
Kafka ClientTsgcWSPClient_KafkaKafkaProducer with acks and gzip, consumer groups with rebalance and offset commits, topic administration.
STOMP ClientTsgcWSPClient_STOMPSTOMPSTOMP 1.0/1.1/1.2 frames: SEND, SUBSCRIBE, ACK, NACK, receipts, heart-beating and transactions.
STOMP RabbitMQ ClientTsgcWSPClient_STOMP_RabbitMQSTOMPSTOMP tuned for RabbitMQ: queue, topic, exchange, external-queue and temporary-queue helpers, over TCP or TLS.
STOMP ActiveMQ ClientTsgcWSPClient_STOMP_ActiveMQSTOMPSTOMP tuned for Apache ActiveMQ, with queue and topic helpers plus an ActiveMQ_Options property.

MQTT 3.1.1 and MQTT 5.0

The publish/subscribe protocol of IoT, with the full quality-of-service machinery exposed rather than hidden.

Capability3.1.15.0Notes
Protocol version selectMQTTVersion takes mqtt311 or mqtt5.
QoS 0, 1 and 2The QoS 2 exchange is surfaced as OnMQTTPubRec, OnMQTTPubRel and OnMQTTPubComp, not swallowed.
Retained messagesThe retain flag is the fourth argument of Publish.
Last Will and TestamentLastWillTestament carries topic, message, QoS and retain.
Wildcard subscriptions+ for one level, # for the rest of the tree.
SessionsThe Session argument of OnMQTTConnect reports whether the broker resumed one.
Publish and waitPublishAndWait blocks until the broker acknowledges the packet.
Publish a streamPublish has a TStream overload for binary payloads.
Reason codes and namesMQTT 5 returns a numeric reason code and its name on CONNACK and DISCONNECT.
CONNECT propertiesConnectProperties sets session expiry, receive maximum, maximum packet size and topic alias maximum.
Topic aliasesA short integer replaces a long topic name on the wire, resolved automatically on inbound packets.
User propertiesArbitrary key/value pairs travel with CONNECT, PUBLISH, SUBSCRIBE and DISCONNECT.
Shared subscriptionsSubscribe to $share/<group>/<topic> to spread deliveries across a group of clients.
Enhanced authenticationThe AUTH packet round trip through Auth and OnMQTTAuth, for challenge/response schemes.
Keep-aliveHeartBeat drives PINGREQ, with OnMQTTPing raised on the response.

AMQP 0.9.1 and AMQP 1.0

Two protocols that share a name and nothing else, so sgcMQ ships a separate component for each rather than pretending one API fits both.

CapabilityAMQP 0.9.1AMQP 1.0Notes
ComponentTsgcWSPClient_AMQPTsgcWSPClient_AMQP1Different wire format, different object model, different component.
Unit of multiplexingChannelSessionOpenChannel against CreateSession.
Topology declarationDeclareExchange, DeclareQueue, BindQueueAMQP 1.0 addresses nodes on the broker instead of declaring them.
SendingPublishMessage(channel, exchange, routingKey, body)SendMessage(session, link, text)Routing key on 0.9.1, target address on 1.0.
ReceivingConsume then OnAMQPBasicDeliverCreateReceiverLink then OnAMQPMessageBoth are push-based once established.
AcknowledgementAckMessage / RejectMessageOnAMQPMessageSentAck0.9.1 acks a delivery tag, 1.0 settles a delivery.
Flow controlSetQoS prefetch, EnableChannel / DisableChannelCredit based (CreditSize, WindowSize)Both stop a fast producer overwhelming a slow consumer.
TransactionsSelectTransaction, CommitTransaction, RollbackTransactionThe 0.9.1 tx class, exposed per channel.
Queue maintenancePurgeQueue, DeleteQueue, DeleteExchange, UnBindQueueCloseLink, CloseSessionEach with a blocking ...Ex variant that waits for the broker reply.
RedeliveryRecover / RecoverAsyncAsk the broker to redeliver unacknowledged messages.
AuthenticationOnAMQPAuthentication, OnAMQPChallengeAuthentication.AuthType, OnAMQPSASLAuthentication1.0 offers SASL ANONYMOUS, PLAIN and EXTERNAL.
Cloud helpersCreateCBSLink, PutCBSToken, CreateAzureCbsSasToken, CreateAzureCbsJWTClaims-Based Security for Azure Service Bus and Event Hubs.
LivenessHeartBeatPing, AMQPOptions.IdleTimeoutNegotiated with the broker on connect.
Connection tuningAMQPOptions.VirtualHost, MaxChannels, MaxFrameSize, LocaleAMQPOptions.ContainerId, ChannelMax, MaxFrameSize, MaxLinksPerSessionSent in the opening handshake and negotiated with the broker.
PrefetchSetQoS(channel, prefetchSize, prefetchCount, global)AMQPOptions.CreditSizeHow many unacknowledged messages the broker may have in flight.
Frame inspectionOnAMQPBeforeReadFrame, OnAMQPBeforeWriteFrameSee or rewrite raw frames before they are processed or sent.

Apache Kafka, Spoken Directly

The binary Kafka protocol implemented in Object Pascal, with no REST proxy in front and no librdkafka underneath.

CapabilityAPINotes
Produce a recordProduce(topic, value, key, partition)Key and partition are optional. ProduceBytes takes TBytes for both.
Produce a batchProduceMessages(topic, partition, messages)Returns the broker's produce response for the whole batch.
Delivery guaranteeKafkaOptions.Producer.AckskafkaAcksNone, kafkaAcksLeader or kafkaAcksAll.
CompressionKafkaOptions.Producer.CompressionkafkaCompressionNone or kafkaCompressionGzip.
ConsumeSubscribe([topics]) then Poll(timeoutMs)Poll returns a TsgcKafkaMessages list and also raises OnKafkaMessage per record.
Consumer groupsKafkaOptions.Consumer.GroupIdCoordinator discovery, join, sync and heartbeat are handled for you. OnKafkaRebalance reports assignment changes.
Offset policyKafkaOptions.Consumer.OffsetResetkafkaOffsetEarliest or kafkaOffsetLatest when there is no committed offset.
Commit offsetsCommitSync, CommitOffset(topic, partition, offset)Or set Consumer.AutoCommit with AutoCommitIntervalMs.
Read a partition directlyFetchMessages(topic, partition, offset, maxBytes)Bypasses the consumer group entirely.
Offset lookupGetEarliestOffset, GetLatestOffset, GetCommittedOffsetPer topic and partition.
Fetch tuningConsumer.MinBytes, MaxBytes, MaxPartitionBytes, MaxWaitMsTrade latency against batch size.
Topic administrationCreateTopic, DeleteTopic, GetMetadataPartition count and replication factor on create.
Group administrationListGroups, DescribeGroupsInspect consumer groups from your own tooling.
Broker capability probeGetApiVersionsAsk the broker which protocol API versions it supports.
SASLkafkaSaslNone, kafkaSaslPlainSASL/PLAIN username and password authentication.

STOMP 1.0, 1.1 and 1.2

One generic client plus two broker-specific descendants that turn RabbitMQ and ActiveMQ destination conventions into named methods.

CapabilitySTOMPRabbitMQActiveMQNotes
Send a frameSendPublishExPublishExDestination, body, content type and optional transaction.
SubscribeSubscribe(id, destination)SubscribeExSubscribeExThe descendants add durable, exclusive and ack-mode arguments.
Queue helpersSubscribeQueue, PublishQueue, UnSubscribeQueueSubscribeQueue, PublishQueue, UnSubscribeQueueThe /queue/ destination prefix, wrapped.
Topic helpersSubscribeTopic, PublishTopic, UnSubscribeTopicSubscribeTopic, PublishTopic, UnSubscribeTopicThe /topic/ destination prefix, wrapped.
Exchange helpersSubscribeExchange, PublishExchangeRabbitMQ's /exchange/ destination with a routing pattern.
External queuesSubscribeQueueOutside, PublishQueueOutsideRabbitMQ's /amq/queue/, for queues declared elsewhere.
Temporary reply queuesSubscribeTemporaryQueue, PublishTemporaryQueueRabbitMQ's /temp-queue/ request/reply pattern.
AcknowledgeACK / NACKAck mode selected per subscription (ackAuto and friends).
TransactionsBeginTransaction, CommitTransaction, AbortTransactionGroup several SEND and ACK frames into one atomic unit.
ReceiptsOnSTOMPReceiptOnRabbitMQReceiptOnActiveMQReceiptThe broker confirms a frame it processed.
Message eventOnSTOMPMessageOnRabbitMQMessageOnActiveMQMessageDelivers the destination, body and frame headers.
Heart-beatingHeartBeat, PingNegotiated in the CONNECT frame, both directions.
Version negotiationVersions.V1_0, V1_1, V1_2Advertise the versions you accept, the broker picks one.
Virtual hostOptions.VirtualHostSent as the host header on CONNECT.
Broker extensionsActiveMQ_OptionsActiveMQ-specific headers, exposed as a published property.

How the Bytes Get to the Broker

Every protocol component attaches to a TsgcTCPClient through its Client property. That one carrier gives you plain TCP and TLS without changing protocol code.

AreaDetail
Plain TCPAssign a TsgcTCPClient to Client and the protocol runs straight over the socket, on the broker's native port.
WebSocketNot in sgcMQ. A WebSocket carrier, for example MQTT over WebSocket or Web-STOMP, needs the WebSocket client that ships with sgcWebSockets.
TLSTLSOptions on the carrier, with TLSOptions.IOHandler choosing OpenSSL for cross-platform builds or SChannel on Windows.
Client certificatesMutual TLS through the same TLSOptions, from a PEM file, a PKCS#12 bundle or the Windows certificate store.
ProxiesHTTP CONNECT proxy support on the carrier, so a broker behind a corporate proxy is reachable.
ReconnectWatchDog on the carrier reconnects after a dropped link, with a configurable interval and attempt count.
IPv6Supported by the carrier, so an IPv6 broker address needs no extra configuration.
ThreadingReading runs on its own thread. Set the carrier's notify settings to marshal events onto the main thread for VCL and FMX code.

Specifications, Compilers and Targets

Published protocols, and the same source across every supported compiler.

AreaDetail
MQTTOASIS MQTT 3.1.1 and MQTT 5.0.
AMQP 0.9.1The AMQP 0-9-1 specification: channels, exchanges, queues, bindings and the basic class.
AMQP 1.0OASIS AMQP 1.0, also published as ISO/IEC 19464.
KafkaThe Apache Kafka wire protocol over TCP, including the v2 record batch format.
STOMPSTOMP 1.0, 1.1 and 1.2.
WebSocketNot included. A WebSocket carrier requires sgcWebSockets, which provides the WebSocket client.
TLSTLS 1.2 and TLS 1.3 through OpenSSL, or Windows SChannel.
CompilersDelphi and C++ Builder 7 through 13.
PlatformsWin32, Win64, Linux64, macOS, iOS and Android.
LicensingStandalone. The sgcWebSockets Core runtime is bundled in and full source code is included.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Build with sgcMQ

Download the free trial and connect to your broker from Delphi or C++ Builder.