How to use @queuebinding with @rabbitlistener?

It seems that with spring -amqp version 1.5 there is a new annotation @queuebinding. But how to use it, I don’t know if it can be used for a class or method? Is there any example?

+5
source share
1 answer

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.

+6
source

Source: https://habr.com/ru/post/1234130/


All Articles