Answer the question
In order to leave comments, you need to log in
Spring-rabbit: how to remove @Exchange declaration from @RabbitListener while keeping bindings annotated?
Goodnight. In spring-amqp 1.5.0M1 , an interesting feature appeared with the creation of bindings through annotations. And everything would be fine, but somehow I really don’t like that the exchange declaration is repeated for each listener. No matter how you have to modify it (exchange) in the future (hemorrhoids will be notable).
In this regard, the question is: is it possible to take out the exchange declaration somewhere in one place, and leave the queue_name and routing_key in the listener's declaration? It is clear that just modifying the RabbitListener will not work, this is not a python for you, but still. I suspect that it is necessary to dig in the direction of RabbitAdmin, but something is not very clear exactly how to dig.
In general, the task is this (in case I'm trying to reinvent the wheel):
There is an application that is divided into several modules and communicates via RabbitMQ. There is something like a user interface (a telegram bot, yeah) that should receive events from modules and send commands to them. I would like everything to be implemented from the bot side using plugins that can be freely added / pulled out of the project without the need to edit the xml / main config.
In fact, I am rewriting a ready-made solution (written by me) in python. Purely from the goal to feel java / spring in real life. In python, everything was elegantly decided by decorators, but java is not python for you ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question