Is it possible to have a single @RabbitListener, e.g:
@RabbitListener(queues = STORAGE_REQUEST_QUEUE_NAME)
public FindApplicationByIdResponse findApplication
That doesn't work with @RabbitListener
on the method level, but it is possible on the class level with the @RabbitHandler
on methods:
@RabbitListener(queues = STORAGE_REQUEST_QUEUE_NAME)
public class MultiListenerBean {
@RabbitHandler
public String bar(Bar bar) {
...
}
@RabbitHandler
public String baz(Baz baz) {
...
}
@RabbitHandler
public String qux(@Header("amqp_receivedRoutingKey") String rk, @Payload Qux qux) {
...
}
}
https://docs.spring.io/spring-amqp/reference/html/#annotation-method-selection