admin管理员组文章数量:1399509
Currently I have annotation properties in my application.properties
, such as:
my.project.MyClass/myFunction/Retry/maxRetries=3
my.project.MyClass/myFunction/Retry/delay=400
Is it possible to put these values in my application.yaml
(that gets picked up at runtime)?
Currently I have annotation properties in my application.properties
, such as:
my.project.MyClass/myFunction/Retry/maxRetries=3
my.project.MyClass/myFunction/Retry/delay=400
Is it possible to put these values in my application.yaml
(that gets picked up at runtime)?
1 Answer
Reset to default 1This is indeed possible, but in a not-exactly-intuitive manner: add a newline and indentation on each .
:
my:
project:
MyClass/myFunction/Retry/maxRetries=3
MyClass/myFunction/Retry/delay=400
However, note that since Quarkus 3.18 (and SmallRye Fault Tolerance 6.7.0), there is a new set of fault tolerance configuration properties that is much more aligned with common Quarkus configuration. It is documented here: https://quarkus.io/guides/smallrye-fault-tolerance#configuration-reference
In the .properties
format, your configuration would look like this:
quarkus.fault-tolerance."my.project.MyClass/myFunction".retry.max-retries=3
quarkus.fault-tolerance."my.project.MyClass/myFunction".retry.delay=400
and in the YAML format:
quarkus:
fault-tolerance:
"my.project.MyClass/myFunction":
retry:
max-retries: 3
delay: 400
The old configuration properties still work, but the new ones are an improvement IMHO.
本文标签: Quarkusset annotation configs in applicationyamlStack Overflow
版权声明:本文标题:Quarkus - set annotation configs in application.yaml - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744122183a2591791.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论