Not sure what your problem is, but here is an example from the reference guide :
@Component public class MyService { @RabbitListener(bindings = @QueueBinding( value = @Queue(value = "myQueue", durable = "true"), exchange = @Exchange(value = "auto.exch"), key = "orderRoutingKey") ) public void processOrder(String data) { ... }
And yes, it can be used both at the class level and at the method level.
source share