In order to connect to an Apache Kafka broker, you must create first a TsgcWebSocketClient and a TsgcWSPClient_Kafka. Then attach the Kafka Component to the WebSocket Client.
Kafka uses a plain TCP connection, so you must set the TsgcWebSocketClient property Specifications.RFC6455 to false. Set the broker Host and Port (the default Kafka port is 9092), optionally set KafkaOptions.ClientId, and then set Active to true to start the connection.
When the connection to the broker is established, the OnKafkaConnect event is raised.
oKafka := TsgcWSPClient_Kafka.Create(nil);
oKafka.KafkaOptions.ClientId := 'sgc-client';
oClient := TsgcWebSocketClient.Create(nil);
oKafka.Client := oClient;
oClient.Specifications.RFC6455 := false;
oClient.Host := 'www.esegece.com';
oClient.Port := 9092;
oClient.Active := True;
procedure OnKafkaConnect(Sender: TObject);
begin
ShowMessage('Connected to Kafka broker');
end;