jiazx0107@163.com
2024-01-01 d454e51e06dbf7beb50551588fc58a5810295d7c
src/main/java/com/fzzy/gateway/hx2023/kafka/KafkaDeviceReportService.java
@@ -22,6 +22,9 @@
    public String publishWithTopic(String sendData, String topic) {
        //推送信息
        kafkaTemplate.send(topic, sendData).addCallback(success -> {
            // 消息发送到的topic
@@ -31,7 +34,7 @@
            // 消息在分区内的offset
            long offset = success.getRecordMetadata().offset();
            log.info("---推送至KAFKA成功--:{}-{}-{}-{}", topic, partition, offset, sendData);
            log.info("---推送至KAFKA成功--:{}-{}", topic, sendData);
        }, failure -> {
            log.info("---推送至KAFKA失败--:{}-{}-{}-{}", topic, sendData);
            rePublishWithTopic(sendData, topic);