class HandlerReceive implements Handler, MessageHandler {
    static final Logger log = LoggerFactory.getLogger(HandlerReceive.class);

    private CloudEventServiceWaterImpl eventService;

    public HandlerReceive(CloudEventServiceWaterImpl eventService) {
        this.eventService = eventService;
    }

    @Override
    public void handle(Context ctx) throws Throwable {
        try {
            if (MethodType.HEAD.name.equals(ctx.method()) || ctx.paramMap().size() == 0) {
                ctx.output("HEAD-OK");
                return;
            }

            String rst = WaterClient.Message.receiveMessage(ctx::param, eventService.getSeal(), this);
            ctx.output(rst);
        } catch (Throwable e) {
            e = Utils.throwableUnwrap(e);
            log.warn(e.getMessage(), e);
            ctx.output(e);
        }
    }

    @Override
    public boolean handle(MessageM msg) throws Throwable {<FILL_FUNCTION_BODY>}
}

        Event event = null;
        if (msg.topic.contains(WaterProps.GROUP_TOPIC_SPLIT_MART)) {
            String[] groupAndTopic = msg.topic.split(WaterProps.GROUP_TOPIC_SPLIT_MART);
            event = new Event(groupAndTopic[1], msg.message);
            event.group(groupAndTopic[0]);
        } else {
            event = new Event(msg.topic, msg.message);
        }

        event.key(msg.key);
        event.tags(msg.tags);
        event.times(msg.times);

        return eventService.onReceive(msg.topic, event); // 可以不吃异常
    
<no_super_class>