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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744122184a4559452.html
评论列表(0条)