Search code examples
javaspringspring-bootspring-cloudspring-cloud-feign

Passing value to placeholder in spring annotation


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.


Solution

  • You can override them in your application.properties file in your project

    testController.name = "myController"
    testController.url = "some url"