Awesome
Kafka-Kotlin-Native
<img src="/kkn.png" width="174px"/>
Fully Native Apache Kafka client for Kotlin Native. Uses native c-interop with highly performant and reliable librdkafka C client library. This library contains no JVM dependencies, no jvm runtime required. It uses Kotlin Native memory model and Multithreaded coroutines for non-blocking interaction with native callbacks and asynchronous workers.
Contribution
We will be glad if you will test kafka-kotlin-native
or contribute to this project.
In case you don't have much time for this - at least spend 5 seconds to give us a star to attract other contributors!
Thanks! :pray: :partying_face:
Acknowledgement
Special thanks to those awesome developers who give us great suggestions, help us to maintain and improve this project: @olonho, @akuleshov7.
Supported platforms
The code has both common and native parts. It can be built for each platform for which librdkafka has support. Currently, this is Linux, Windows and Mac OSX.
For more information about platforms and how to install librdkafka see librdkafka installation
Dependency
The library is hosted on the Maven Central.
To import kafka-kotlin-native
library you need to add following dependency to your code:
<dependency>
<groupId>com.icemachined</groupId>
<artifactId>kafka-client</artifactId>
<version>0.2.0</version>
</dependency>
</details>
<details>
<summary>Gradle Groovy</summary>
implementation 'com.icemachined:kafka-client:0.2.0'
</details>
<details>
<summary>Gradle Kotlin</summary>
implementation("com.icemachined:kafka-client:0.2.0")
</details>
Features
- Synchronous and asynchronous send
- Leverages kotlin-native coroutines and memory model
- Polling Kafka consumer
- Parallel polling Kafka consumer
- Headers enrichment
- Error handling extension points
- Possibility to leverage kotlinx.serialization features
How to use
See example of usage in example project This example shows how to start/stop producer and consumer and how to configure it.
Configuration
- librdkafka configuration properties, which you can pass to producer and consumer constructor.
- Serializer/Deserializer for key and value.