class RedisGpsMsgListener implements MessageListener {

    private final static Logger logger = LoggerFactory.getLogger(RedisGpsMsgListener.class);

    @Autowired
    private IRedisCatchStorage redisCatchStorage;

    @Autowired
    private IVideoManagerStorage storager;

    private ConcurrentLinkedQueue<Message> taskQueue = new ConcurrentLinkedQueue<>();

    @Qualifier("taskExecutor")
    @Autowired
    private ThreadPoolTaskExecutor taskExecutor;


    @Override
    public void onMessage(@NotNull Message message, byte[] bytes) {<FILL_FUNCTION_BODY>}

    /**
     * 定时将经纬度更新到数据库
     */
    @Scheduled(fixedRate = 2 * 1000)   //每2秒执行一次
    public void execute(){
        List<GPSMsgInfo> gpsMsgInfo = redisCatchStorage.getAllGpsMsgInfo();
        if (gpsMsgInfo.size() > 0) {
            storager.updateStreamGPS(gpsMsgInfo);
            for (GPSMsgInfo msgInfo : gpsMsgInfo) {
                msgInfo.setStored(true);
                redisCatchStorage.updateGpsMsgInfo(msgInfo);
            }
        }
    }
}

        boolean isEmpty = taskQueue.isEmpty();
        taskQueue.offer(message);
        if (isEmpty) {
            taskExecutor.execute(() -> {
                while (!taskQueue.isEmpty()) {
                    Message msg = taskQueue.poll();
                    try {
                        GPSMsgInfo gpsMsgInfo = JSON.parseObject(msg.getBody(), GPSMsgInfo.class);
                        logger.info("[REDIS的位置变化通知], {}", JSON.toJSONString(gpsMsgInfo));
                        // 只是放入redis缓存起来
                        redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
                    }catch (Exception e) {
                        logger.warn("[REDIS的位置变化通知] 发现未处理的异常, \r\n{}", JSON.toJSONString(message));
                        logger.error("[REDIS的位置变化通知] 异常内容： ", e);
                    }
                }
            });
        }
    
<no_super_class>