What would be the easiest way to construct this at runtime?
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "providedAtRuntime", durable = "true"),
exchange = @Exchange(value = "providedAtRuntime", ignoreDeclarationExceptions = "true"),
key = "providedAtRuntime"), containerFactory = "cFac")
public class RabbitProcessor {
@RabbitHandler
public void receive (String smth){
System.out.println(smth);
}
}
I would like to define the listener, but provide exchange, queue name and binding at runtime. Also this listener should not start automatically, but when called by start() method. At same time it should auto-declare bindings and queues etc. When called stop(), it should just stop consuming.