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: 考试断点记录数据持久化 
* @Param:  
* @return:  
* @Author: wangliang
* @Date: 2020/11/26 
*/ 
@Service
public class ExamRecordBreakHistoryPersistedConcurrentlyImpl 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_BREAK_HISTORY_PERSISTED_LOGIC);
    }
}
