package com.qmth.themis.admin.listener.service.impl;

import com.qmth.themis.admin.listener.service.MqAdminLogicService;
import com.qmth.themis.business.dto.MqDto;
import com.qmth.themis.business.service.TMRocketMessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;

/**
 * @Description: mq 管理端执行逻辑 impl
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/8/3
 */
@Service
public class MqAdminLogicServiceImpl implements MqAdminLogicService {
    private final static Logger log = LoggerFactory.getLogger(MqAdminLogicServiceImpl.class);

    @Resource
    TMRocketMessageService tmRocketMessageService;

    @Override
    @Transactional
    public void execMqMaxReconsumeTime(MqDto mqDto, String key) {
        //超过最大重试次数，保存到数据库，后续可以发短信通知系统管理人员
        tmRocketMessageService.saveMqMessageError(mqDto, key);
    }

    @Override
    @Transactional
    public void execMqAdminLogic(MqDto mqDto, String key) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {

    }
}
