Kafka生产者-无法将记录追加到只读镜像主题

5hcedyr0  于 12个月前  发布在  Apache
关注(0)|答案(1)|浏览(88)

我运行了一个生产者,并使用以下代码引发了一个异常。

@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);
    }
e0bqpujr

e0bqpujr1#

Mirror topics are read only
您需要找到它们从哪里镜像,然后生成到该集群/主题。

相关问题