Spring boot 有没有办法在spring boot中外部化@Scheduled注释的值?

Spring boot 有没有办法在spring boot中外部化@Scheduled注释的值?,spring-boot,Spring Boot,由于spring boot中的@Scheduled annotation key'fixedRate'只接受常量,我想知道是否有其他方法可以将此属性外部化到外部属性文件中?查看;大多数属性都有一个字符串后缀对应项,在您的例子中是fixedRateString。字符串后缀属性可用于插入SPeL和占位符表达式,例如: @Scheduled(fixedRateString=“${Scheduled.fixedRate}”) public void someMethod(){…} applicatio

由于spring boot中的@Scheduled annotation key'fixedRate'只接受常量,我想知道是否有其他方法可以将此属性外部化到外部属性文件中?

查看;大多数属性都有一个
字符串
后缀对应项,在您的例子中是
fixedRateString
。字符串后缀属性可用于插入SPeL和占位符表达式,例如:

@Scheduled(fixedRateString=“${Scheduled.fixedRate}”)
public void someMethod(){…}
application.properties:

scheduled.fixedRate=1000
看一看,;大多数属性都有一个
字符串
后缀对应项,在您的例子中是
fixedRateString
。字符串后缀属性可用于插入SPeL和占位符表达式,例如:

@Scheduled(fixedRateString=“${Scheduled.fixedRate}”)
public void someMethod(){…}
application.properties:

scheduled.fixedRate=1000