I am trying to override an interface Timeout Fault tolerance annotation in application.properties. However I am not sure if it is possible to override annotation parameters via configuration file using property [classname/methodname/]annotation/parameter for an interface? Any idea what would be the syntax for interface?
Here is my ReST client Interface:
package com.myProject;
@RegisterRestClient(configKey = "test")
@Timeout
public interface MyInterface{
@POST
@Path("/my-endpoint")
Uni<AResponse> create(ARequest request);
}
And here is my application.properties:
com.myProject.MyInterface/Timeout/value=2000
looking into the Quarkus dev UI dashboard, Timeout value is still 1000 which is the default value.
Just set it in annotation
You could try setting it directly in the annotation value like this :
And override in
application.propertiesif neededAccording to SmallRye Fault Tolerance Documentation, you should be able to override value using one of these :
annotation-name/property-name=valuefully-qualified-class-name/method-name/annotation-name/property-name=valueWhich in your case should be :
Or
Notice I only added method name
createto the latest oneEdit
I believe you have to set your annotation
@Timeoutat the method level and add value like example above