Reputation: 19
I have generated a client interface from api specs
@FeignClient(
name = "${testController.name:testController}",
url = "${testController.url:https://api.dev.foo}",
configuration = {ClientConfiguration.class}
)
public interface TetsControllerApiClient extends TestControllerApi {
}
How can I override the name
, or url
properties on it? Will appreciate an help. Thanks.
Upvotes: 0
Views: 1060
Reputation: 44466
This is loaded from the properties file (either application.yml
or application.properties
).
The notation ${testController.name:testController}
is a Spring expression language and says the following:
testController.name
and read its value from the properties.testController
as a default value instead.The application.properties
file shall look like:
testController.name=myTestController
To override the value you can use Spring profiles. File application-local-dev.properties
and starting the application with the local-dev
profile.
Upvotes: 3
Reputation: 306
You can override them in your application.properties file in your project
testController.name = "myController"
testController.url = "some url"
Upvotes: 1