I would like to use the same client class for multiple @FeignClient#name and the name would be calculated at runtime with multiples parameters. Ex : name could be

param1 + "-"+param2+"-SERVICE"

and param1 & param2 depend on the context.

is there any solution to solved this ?

Like this

@FeignClient(name = "{param1}-{param2}-email-service")
public interface EmailClient {
}

and provided those parameters in anyway ?

Comment From: ryanjbaxter

The only way I can think of doing this today is by manually creating the Feign clients using the Feign Builder API

https://cloud.spring.io/spring-cloud-static/Greenwich.SR2/single/spring-cloud.html#_creating_feign_clients_manually

Comment From: laugues

Thank you @ryanjbaxter this can be a solution. I finally use the FeignClientBuilder which is usefull and not documented. Add a little paragraph for explain it's aim and how to use it will be great ;-)

Here a code sample

// Without @FeignClient annotation
public interface EmailClient {
}  

and create the client

EmailClient emailClient = new FeignClientBuilder()
.forType(EmailClient.class, "The Service Name built a runtime")
.build();

Comment From: ryanjbaxter

@laugues it is documented in the link I posted above