rabbitMQ实现多线程消费

https://blog.csdn.net/weixin_39080782/article/details/112788005

简单点 通过注解并发
搜了一些方法,最多的就是在RabbitListeners注解上加上concurrency属性

 @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue(value = "myQueue1"),
                    exchange = @Exchange(value = "myExchange1"),
                    key = "routingKey1"
            ),
            concurrency =  "10"
    )
    public void process1(Message message) throws Exception {
        // 执行程序
    }

版权声明:本文为m0_67394360原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。