你这脱离了spring就不会写代码了吗?那劝你还是放弃吧,得不偿失。在android上用kafka client有很多坑,要考虑很多东西。
【 在 feng321 的大作中提到: 】
: 标 题: Re: 有大佬用过kafka吗?kafka-clent.jar能在Android上跑吗?
: 发信站: 水木社区 (Tue Apr 25 14:45:20 2023), 站内
:
:
: @Slf4j
: @Component
: public class KafkaConsumerListener {
: @KafkaListener(topics = "test2")
: public void onMessage(String message){
: // 消费消息
: // 这里为插入数据库代码
: //insertIntoDb(buffer);
: log.info("接收到消息:" + message);
: }
:
: }
:
: 我看到的springboot client端,是这样配置topic的。手机端如何配置啊?
: 【 在 eventvwr 的大作中提到: 】
: : 好家伙感情你是从来没用过kafka啊。
: : Properties props = new Properties();
: : props.put("bootstrap.servers", "xxx"); // Kafka集群地址
: : ...................
:
: --
:
: ※ 来源:·水木社区
http://www.mysmth.net·[FROM: 120.242.253.*]
--
FROM 1.202.162.*