我运行了一个生产者,并使用以下代码引发了一个异常。
@GetMapping("/send")
public ResultVo send(@RequestParam(value = "content") String content) {
return new ResultVo(kafkaTemplate.send("hello-topic", 0, "test", content));
}
2023-08-07 21:00:12.330 ERROR 1508 --- [ad | producer-1] o.s.k.support.LoggingProducerListener : Exception thrown when sending a message with key='test' and payload='test content' to topic hello-topic and partition 0:
org.apache.kafka.common.errors.InvalidRequestException: Cannot append records to read-only mirror topic
虽然生产者不工作,我写了一个消费者,可以正常获得消息。
@KafkaListener(topics = "hello-topic", groupId = "hello-group")
public void handleMessage(String content) {
log.info("{}", content);
}
1条答案
按热度按时间e0bqpujr1#
Mirror topics are read only
您需要找到它们从哪里镜像,然后生成到该集群/主题。