Delphi-Kafka icon indicating copy to clipboard operation
Delphi-Kafka copied to clipboard

Example

Open Zhikter opened this issue 5 years ago • 4 comments

Is it possible to get a basic example on how to

  1. connect
  2. post something to a producer
  3. read something from a consumer?

Zhikter avatar Jul 15 '19 14:07 Zhikter

Would also like a basic example. @Zhikter did you get anything working?

norgepaul avatar Jul 29 '20 08:07 norgepaul

I landed up looking at the librdkafka examples and then translating them from C to pascal/delphi.

I use rd_kafka_produce which was not in uLibkafka.pas so I had to add it myself.

This code works on my machine using XE7. I am not making any promises. ;-p

Example.zip

Zhikter avatar Jul 29 '20 14:07 Zhikter

@Zhikter That's a good start. Thanks :)

norgepaul avatar Jul 30 '20 07:07 norgepaul

@Zhikter I took your example and wrote a new cross-platform (Windows/Linux) library around a fresh import of the Kafka header. It has a demo and several helpers and wrappers. You can take a look here - https://github.com/norgepaul/DelphiKafkaClient. Feedback is appreciated.

norgepaul avatar Aug 04 '20 12:08 norgepaul