TsgcWSPClient_KafkaEvents › OnKafkaProduce

OnKafkaProduce Event

Fires after a record is produced.

Syntax

property OnKafkaProduce: TsgcKafkaProduceEvent;
// procedure(Sender: TObject; const aTopic: string; aPartition: Integer; aOffset: Int64; aErrorCode: SmallInt) of object

Default Value

Remarks

Fires after a record is produced, reporting the partition and offset. aErrorCode is 0 on success, and aOffset is where the record was stored within the partition.

Example

procedure TForm1.KafkaProduce(Sender: TObject; const aTopic: string;
  aPartition: Integer; aOffset: Int64; aErrorCode: SmallInt);
begin
  if aErrorCode = 0 then
    Log(Format('Produced to %s [%d] @ offset %d', [aTopic, aPartition, aOffset]));
end;

Back to Events