puzhibing
2026-02-27 7f60d8e9db4fe0a38d7c2296ade1ea4dde74d3f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.xiaopeng.automaticPilot.controller;
 
import com.xiaopeng.automaticPilot.service.KafkaConsumerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.web.bind.annotation.RestController;
 
 
@Slf4j
@RestController
public class KafkaTestController {
 
    @Autowired
    private KafkaConsumerService kafkaConsumerService;
 
 
 
 
    /**
     * 消费消息 - XPU上报Robotaxi云端的消息topic(高优先级)
     *
     * @param message 消息内容
     */
    @KafkaListener(topics = "topic-prod-robotaxi-xpu-high", groupId = "group-robotaxi-xpu")
    public void topicProdRobotaxiXpuHigh(String message) {
        log.info("收到XPU上报高优先级主题消息: {}", message);
        kafkaConsumerService.topicProdRobotaxiXpuHigh(message);
    }
 
    /**
     * 消费消息 - XPU上报Robotaxi云端的消息topic(低优先级)
     *
     * @param message 消息内容
     */
    @KafkaListener(topics = "topic-prod-robotaxi-xpu-normal", groupId = "group-robotaxi-xpu")
    public void topicProdRobotaxiXpuNormal(String message) {
        log.info("收到XPU上报低优先级主题消息: {}", message);
        kafkaConsumerService.topicProdRobotaxiXpuNormal(message);
    }
}