I have application.properties file for spring app which contains some simple properties:
queue=my.test.q
in the java code i need to specify the queue to @RabbitListener:
@Component
public class Handler {
@RabbitListener(queues = "my.test.q")
public void handleMessage(Message message) {
...
}
that would work, but i want to pass parameter to the annotation, i've tried the following but none of them worked.
@Component
public class Handler {
@Value("${queue}")
private String queueName;
@RabbitListener(queues = @Value("${queue}") <-- not working
@RabbitListener(queues = queueName)) <--- not working
public void handleMessage(Message message) {
...
}
is it possible to that?