I want to be able to set the @JMSlistener destination from an application.properties
my code looks like this
@Service
public class ListenerService {
private Logger log = Logger.getLogger(ListenerService.class);
@Autowired
QueueProperties queueProperties;
public ListenerService(QueueProperties queueProperties) {
this.queueProperties = queueProperties;
}
@JmsListener(destination = queueProperties.getQueueName() )
public void listenQueue(String requestJSON) throws JMSException {
log.info("Received " + requestJSON);
}
}
but when building I get
Error:(25, 60) java: element value must be a constant expression