@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集群地址
: ...................
--
FROM 120.242.253.*