John Little
John Little

Reputation: 12447

Is there a difference between using value and using name?

There are code examples which have value:

@FeignClient(value = "jplaceholder", url = "https://jsonplaceholder.typicode.com/")
public interface JSONPlaceHolderClient {

and others which have name or nothing:

@FeignClient("stores")
public interface StoreClient {

@FeignClient(name = "stores", configuration = FooConfiguration.class)
public interface StoreClient {

In the source code for feign, it has two separate fields, one called name and one called value:

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface FeignClient {
    @AliasFor("name")
    String value() default "";

    @AliasFor("value")
    String name() default "";

Is there any difference between using value and name? We are having problems with feign and cannot figure out what's causing it.

Upvotes: 1

Views: 40

Answers (0)

Related Questions