TsgcWSPClient_KafkaMethods › Produce

Produce Method

Publishes a string record to a topic.

Syntax

procedure Produce(const aTopic: string; const aValue: string; const aKey: string = ''; aPartition: Integer = -1);

Parameters

Remarks

Sends a single string record to the broker. When a key is supplied it is used to route the record to a partition; when the key is empty and the partition is -1, the record is written to the default partition. Use ProduceBytes for binary payloads or ProduceMessages to send a batch of records in one request.

Example

oKafka.Produce('my-topic', 'Hello Kafka', 'key-1');

Back to Methods