1 @KafkaListener(topics = {Constant.TOPIC}, groupId = “imooc-coupon-1”)’'
加上这个注解
是指怎样消费服务器上的消息,消费topic里面的消息吗?
2 // 发送到 kafka 中做异步处理
kafkaTemplate.send(
Constant.TOPIC,
JSON.toJSONString(new CouponKafkaMessage(
CouponStatus.EXPIRED.getCode(),
classify.getExpired().stream()
.map(Coupon::getId)
.collect(Collectors.toList())
))
);
这种发送到kafka上的消息做异步处理
是等@KafkaListener注解的类,得到消息之后去处理吗?还是怎么异步处理的