卡夫卡监听类的判断

System.err.println("接收到了消息");
        String value = data.value();
        System.err.println("消息类型:"+value);
        if (value.startsWith("save")) {
            String[] split = value.split("=");
            Plan plan = JSON.parseObject(split[1],Plan.class);
            planretest.save(plan);
            System.err.println("添加的内容同步到es");
        }
        if (value.startsWith("update")) {
            String[] split = value.split("=");
            Plan plan = JSON.parseObject(split[1],Plan.class);
            planretest.save(plan);
            System.err.println("修改的内容同步到es");
            redisTemplate.delete("plan");
            System.err.println("同步Redis");
        }
原文地址:https://www.cnblogs.com/liujinqq7/p/12693981.html