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

业务日志添加

parent 12c6ee19
......@@ -117,12 +117,4 @@ public class RabbitConfig {
return new Jackson2JsonMessageConverter();
}
// @Bean
public AsyncRabbitTemplate asyncRabbitTemplate(RabbitTemplate rabbitTemplate) {
AsyncRabbitTemplate asyncRabbitTemplate = new AsyncRabbitTemplate(rabbitTemplate);
asyncRabbitTemplate.setReceiveTimeout(10000);
return asyncRabbitTemplate;
}
}
......@@ -34,8 +34,9 @@ import java.util.stream.Collectors;
**/
@Slf4j
@Component
@RabbitListener(queues = QueueKey.OPERATION_LOG_QUEUE,
containerFactory = "consumerBatchContainerFactory")
@RabbitListener(queues = QueueKey.OPERATION_LOG_QUEUE)
//@RabbitListener(queues = QueueKey.OPERATION_LOG_QUEUE,
// containerFactory = "consumerBatchContainerFactory")
public class OperateMessageConsumerListener {
@Autowired
......@@ -55,6 +56,12 @@ public class OperateMessageConsumerListener {
operateLogService.save(collect);
}*/
@RabbitHandler
public void onMessage(@Payload String messages) {
log.info("[operate onMessage][线程编号:{} 消息:{}]", Thread.currentThread().getName() + Thread.currentThread().getId(), messages);
}
@RabbitHandler
public void onMessage(@Payload List<String> messages) {
log.info("[operate 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