package com.qmth.themis.mq.templete.impl;

import com.qmth.themis.business.constant.SpringContextHolder;
import com.qmth.themis.business.enums.MqExecTypeEnum;
import com.qmth.themis.mq.service.MqLogicService;
import com.qmth.themis.mq.templete.Concurrently;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.common.message.MessageExt;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考试记录数据更新
 *
 * @Description:
 * @Author: xiatian
 * @Date: 2020-08-04
 */
@Service
public class ExamRecordUpdateConcurrentlyImpl implements Concurrently {

    @Override
    public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
        MqLogicService mqLogicService = SpringContextHolder.getBean(MqLogicService.class);
        return mqLogicService.consumeMessage(msgs, consumeConcurrentlyContext, MqExecTypeEnum.EXEC_MQ_RECORD_UPDATE_LOGIC);
    }
}
