Kafka Producer on Android

后端 未结 2 1616
时光取名叫无心
时光取名叫无心 2021-01-06 02:34

I would like to use an Android client as a Kafka Producer. When I try to send a record to the topic I\'m getting following error:

Didn\'t find class \"java.l

相关标签:
2条回答
  • 2021-01-06 02:49

    That API is not a part of Android, and is not compatible with Android. The java.lang.management API is for managing and monitoring the Java VM. Android's Dalvik VM is not a Java VM.

    0 讨论(0)
  • 2021-01-06 02:59

    I'm actually not sure it's possible to use Kafka as a producer on Android (see for instance, this question, not answered at the moment of writing), because of the dependencies involved. So, someone might have ported Kafka to Android but I don't know that.

    I could suggest a simple alternative: REST service that posts data to Kafka, and Android App will just call this service.

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