Commit e7f2c60a authored by 赵啸非's avatar 赵啸非

异常日志前端展示添加

parent 6f794689
......@@ -37,14 +37,25 @@ import java.util.stream.Collectors;
**/
@Slf4j
@Component
@RabbitListener(queues = QueueKey.ACCESS_LOG_QUEUE,
containerFactory = "consumerBatchContainerFactory")
//@RabbitListener(queues = QueueKey.ACCESS_LOG_QUEUE,
// containerFactory = "consumerBatchContainerFactory")
@RabbitListener(queues = QueueKey.ACCESS_LOG_QUEUE)
public class AccessMessageConsumerListener {
@Autowired
private AccessLogService accessLogService;
@RabbitHandler
public void onMessage(AccessLogEntity entity) throws Exception {
log.info("[Access onMessage single]");
entity.setId(IdUtil.getSnowflake(0, 1).nextId());
entity.setCreateUserId(1L);
entity.setCreateTime(new Date());
accessLogService.save(entity,null);
}
//@RabbitHandler
public void onMessage(@Payload List<String> messages) throws Exception {
log.info("[Access onMessage][线程编号:{} 消息数量:{}]", Thread.currentThread().getName() + Thread.currentThread().getId(), messages.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment