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

异常日志前端展示添加

parent 6f794689
...@@ -37,14 +37,25 @@ import java.util.stream.Collectors; ...@@ -37,14 +37,25 @@ import java.util.stream.Collectors;
**/ **/
@Slf4j @Slf4j
@Component @Component
@RabbitListener(queues = QueueKey.ACCESS_LOG_QUEUE, //@RabbitListener(queues = QueueKey.ACCESS_LOG_QUEUE,
containerFactory = "consumerBatchContainerFactory") // containerFactory = "consumerBatchContainerFactory")
@RabbitListener(queues = QueueKey.ACCESS_LOG_QUEUE)
public class AccessMessageConsumerListener { public class AccessMessageConsumerListener {
@Autowired @Autowired
private AccessLogService accessLogService; private AccessLogService accessLogService;
@RabbitHandler @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 { public void onMessage(@Payload List<String> messages) throws Exception {
log.info("[Access onMessage][线程编号:{} 消息数量:{}]", Thread.currentThread().getName() + Thread.currentThread().getId(), messages.size()); 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