I´m trying to use a Configuration in an Annotation, like so:
@ConfigurationProperties("scheduling")
interface SchedulingConfiguration {
val initialDelay: String
val fixedDelay: String
}
@Singleton
class Worker(
private val configuration: SchedulingConfiguration,
) {
private val log = LoggerFactory.getLogger(javaClass)
@Scheduled(initialDelay = configuration.initialDelay, fixedDelay = configuration.fixedDelay)
fun fetchQueueEntry() {
log.info("Fetching entry")
}
}
I´m getting the warning An annotation argument must be a compile-time constant.
Is there some way to get this working with Micronaut?