spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.87k stars 2.44k forks source link

Feign Configuration not working if using Service Discovery #2302

Closed khannedy closed 6 years ago

khannedy commented 7 years ago

if I using url in feign client, the configuration is working normally

@FeignClient(
    name = "merchantFeign",
    url = "http://localhost:8080",
    configuration = MerchantFeignConfiguration.class,
    fallbackFactory = MerchantFeignFallbackFactory.class
)
public interface MerchantFeign {
2017-09-27 12:05:58.440 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] ---> POST http://localhost:8181/api/merchants/_validate HTTP/1.1
2017-09-27 12:05:58.440 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] Accept: application/json
2017-09-27 12:05:58.441 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] Content-Type: application/json
2017-09-27 12:05:58.441 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] Content-Length: 45
2017-09-27 12:05:58.441 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] 
2017-09-27 12:05:58.441 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] {"secretKey":"blibli","remoteIp":"127.0.0.1"}
2017-09-27 12:05:58.441 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] ---> END HTTP (45-byte body)
2017-09-27 12:05:58.464 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] <--- HTTP/1.1 200 (22ms)
2017-09-27 12:05:58.464 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] content-type: application/json;charset=UTF-8
2017-09-27 12:05:58.464 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] date: Wed, 27 Sep 2017 05:05:58 GMT
2017-09-27 12:05:58.464 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] transfer-encoding: chunked
2017-09-27 12:05:58.464 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] 
2017-09-27 12:05:58.465 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] {"code":200,"status":"OK","data":{"id":"c1d6493e-6f6f-403a-b6ee-ef4762639572","merchantId":"blibli","merchantName":"Blibli","privileges":["PARTNER"],"version":0,"createdDate":1505807420144,"createdBy":"XXX","lastModifiedBy":"XXX","lastModifiedDate":1505807420144}}
2017-09-27 12:05:58.465 DEBUG [wallet-api,029402413c43bee2,2ff13512986527b9,false] 13272 --- [merchantFeign-1] com.gdn.wallet.api.feign.MerchantFeign   : [MerchantFeign#validate] <--- END HTTP (264-byte body)

But, if I using Service Discovery

@FeignClient(
    name = "merchantFeign",
    serviceId = "wallet-merchant",
    configuration = MerchantFeignConfiguration.class,
    fallbackFactory = MerchantFeignFallbackFactory.class
)
public interface MerchantFeign {

the configuration is not working, I don't see feign log anymore.

khannedy commented 7 years ago

I'm using Dalston.SR3</spring-cloud.version>

ryanjbaxter commented 7 years ago

Can you provide an example that reproduces this via a zip or github repo?

spencergibb commented 6 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.