package com.qmth.teachcloud.task.job;

import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.task.job.service.JobService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @Description: redis mq消息同步
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/7/9
 */
public class RedisMqSyncJob extends QuartzJobBean {
    private final static Logger log = LoggerFactory.getLogger(RedisMqSyncJob.class);

    @Resource
    JobService jobService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            jobService.assembleJob(SystemConstant.MQ_TOPIC_BUFFER_LIST);
        } catch (Exception e) {
            log.error(SystemConstant.LOG_ERROR, e);
        }
    }
}
