How to Achieve Concurrency With a Non-Thread-Safe MessageListener
问题 The answer to this question explains how to use prototype scope with <rabbit:listener-container/> in Spring AMQP when the listener is not thread-safe. Another user asked (in a comment) how to configure the same environment using only Java Configuration. 回答1: It's generally best practice to use stateless beans for listeners but when that's not possible, to configure @Prototype scope listener (and multiple containers) using only Java Configuration, you can use: @Bean public