How can we create Kafka producer in Android application?

后端 未结 2 1437
南方客
南方客 2020-12-12 05:13

I\'am new to apache kafka and I\'am trying to use it on android studio in order to produce data to my server located on my pc using codes from A simple Kafka Consumer and Pr

相关标签:
2条回答
  • 2020-12-12 05:48

    I figured out that we cannot create kafka in android. It is better to create an application for kafka that exposes REST end points, which can be later called in android app. You can create it in any language or framework, I have done it in spring boot and it is working fine.

    https://github.com/vpkeerthan/Kafka/tree/master/KafkaRestService

    Android app using RESTful endpoints exposed for kafka services https://github.com/vpkeerthan/Android-Tutorial/tree/master/Kafka-REST-Android

    0 讨论(0)
  • 2020-12-12 06:05

    You wouldn't. This would be insecure. You'd send a request to a webservice, and it would send data to Kafka. Anything else would require your Kafka servers to be public with the authentication info in the app, which is basically then open to anyone.

    0 讨论(0)
提交回复
热议问题