To understand why it is not possible we need to understand how and what Spring does when you do something like this:
@Scheduled(fixedRateString = "${scheduler.fixedrate:10}")
public void init(){}
The string ${scheduler.fixedrate:10} was assigned to fixedRateString and won't get replaced by the value in your application.yml. You maybe thought fixedRateString would get the actual value from your application.yml which is not the case, it simply gets the value you configured.
Now when your application starts, Spring will interpret this string and then resolves it to your value in the application.yml and use it to setup scheduling, so this replacement happens at runtime and NOT at compile-time, this is the key point.
You wrote There should be a solution. It doesn't make sense that this feature is only implemented for String values. which is not entirely correct. It is not tied to string values, just the key of the property you define in the annotation is a string but the actual value of the property can be of any type.
Preprocessors
What you probably want is a preprocessor which processes the source files before they get compiled (like C has one). But Java has no such preprocessor. Furthermore, it would not be possible for Spring, to implement such a preprocessor if Java would provide such a possibilty. The reason is, that values of properties are determined at runtime, as the application.yml is not the only place where one can configure properties. So even if Java would support preprocessors, there is no way to replace the key with the actual value as the value cannot be determined at compile time.
fixedRatealongitself? Then this is never going to work. You cannot use a Spring property to provide that value.Stringto alongand expecting Spring to magically fix it.