MySQL筛选多列重复的记录
单列去重比较简单,如果多列要去重,怎么找出重复的值?
1 | SELECT |
Spring boot启动时不加载RabbitMQ
Spring boot 项目中,集成了 RabbitMQ。但有时候,做测试的时候,可能 RabbitMQ 并未启动,这时就会导致项目启动时间很长,还会报如下错误信息:
1 | 020-05-05 18:00:22.267 ERROR 78855 --- [ main] o.s.a.r.l.SimpleMessageListenerContainer : Consumer failed to start in 60000 milliseconds; does the task executor have enough threads to support the container concurrency? |
如何不启动 RabbitMQ 呢?
我们只需要在启动类或者是测试启动类上添加如下注解:
1 | @EnableAutoConfiguration(exclude = {RabbitAutoConfiguration.class}) |
同时在注入了 RabbitTemplate 的类上面添加如下注解:
1 | @Profile("no_rabbit") |
no_rabbit 任意写,只要不是我们启动类的 Profile 就可以了。