I have an error with this code, I can't find a functional solution.
@RabbitListener(queues = {"${queue.name}"})
public void receive(@Payload String payload) {
try {
Alert temp = new ObjectMapper().readValue(payload, Alert.class);
if(temp != null) {
int idTemp = temp.getId();
while(verifyID(idTemp) != -1) {
idTemp++;
}
temp.setId(idTemp);
alertArray.add(temp);
}
} catch(IOException e) {
}
}
application.properties :
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
queue.name=test
Error :
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'queue.name' in value "${queue.name}"