0

In my project, diffrent services are deployed as microservices and authorization and authentication is handled in a common jar file which added as a dependency in each micro-service project.

The communication between microservice are done through feign client

Gradle file for such a service is given below

dependencies {
    compile('org.springframework.boot:spring-boot-starter')
    compile('org.springframework.cloud:spring-cloud-starter-eureka'){
    compile('org.springframework.cloud:spring-cloud-starter-config')
    compile('org.springframework.cloud:spring-cloud-starter-hystrix')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile ('org.springframework.cloud:spring-cloud-starter-hystrix-dashboard')
    compile('org.springframework.cloud:spring-cloud-starter-sleuth')
    compile('org.springframework.cloud:spring-cloud-starter-oauth2')
    compile("org.springframework.cloud:spring-cloud-starter-feign")
    }

In one scenario I forced to use feign client in my OAuth library to call my authorization microservices and the dependency file for the jar is given below

dependencies {
    compile('org.springframework.cloud:spring-cloud-starter-oauth2:1.1.3.RELEASE')
    compile('com.nimbusds:nimbus-jose-jwt:4.33')
    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign', version: '1.3.1.RELEASE'
    compile("org.springframework.cloud:spring-cloud-starter-feign")
      } 

But when I deploy the new jar file with my services the feign client implemented inside my jar file is not working.The call is directly hit to the fallback service.

I removed this feign client and added & tested it within a microservice and it is working fine.

Please help me to resolve this issue

Anoop M Nair
  • 1,057
  • 1
  • 13
  • 31

1 Answers1

0

I resolved the issue .It was my bad. The issue is in my feign configuration. corrected the same. Instead of "value" I used "name" .

  @FeignClient(value = "customer-service", fallback = CustomerFeignFallback.class, configuration = FeignConf.class)
    public interface CustomerFeignClient {

This works for me.

Anoop M Nair
  • 1,057
  • 1
  • 13
  • 31