|
|
|
@ -8,13 +8,16 @@ import com.glxp.api.entity.trace.TraceTaskHistoryEntity;
|
|
|
|
|
import com.glxp.api.entity.trace.TraceTaskNoticeEntity;
|
|
|
|
|
import com.glxp.api.service.trace.TraceTaskHistoryService;
|
|
|
|
|
import com.glxp.api.service.trace.TraceTaskNoticeService;
|
|
|
|
|
import com.rabbitmq.client.Channel;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.amqp.core.Message;
|
|
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@ -34,8 +37,12 @@ public class TraceSearchReceiver {
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@RabbitListener(queues = TopicRabbitConfig.delaytrace)
|
|
|
|
|
public void traceDeleyReceiver(MqTaskDelayMessage mqTaskDelayMessage) {
|
|
|
|
|
|
|
|
|
|
public void traceDeleyReceiver(MqTaskDelayMessage mqTaskDelayMessage, Channel channel, Message message) {
|
|
|
|
|
try {
|
|
|
|
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(), true);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
if (mqTaskDelayMessage.getTaskStatus() == 1 || mqTaskDelayMessage.getTaskStatus() == 2) {
|
|
|
|
|
log.info(mqTaskDelayMessage.getTaskId() + ":任务超时未处理,更改状态为超时异常");
|
|
|
|
|
TraceTaskNoticeEntity taskNoticeEntity = taskNoticeService.getById(mqTaskDelayMessage.getTaskId());
|
|
|
|
|