2017-06-20 5 views
0

私のプロジェクトでは、異なるサービスがマイクロサービスとして配備され、許可と認証は各マイクロサービスプロジェクトに依存して追加された共通のjarファイルで処理されます。Feignクライアントがサービスをロードできない

microservice間の通信を装うクライアントを介して行われGradleのは、そのようなサービスのためのファイル

は、私は私の承認を呼び出すために私のOAuthライブラリに装うクライアントを使用するように強制1つのシナリオでは

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") 
    } 

以下に示します。マイクロサービスとjarファイルの依存関係ファイルは以下の通りです

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") 
     } 

私のサービスで新しいjarファイルを展開すると、fe私のjarファイル内に実装されたignクライアントは動作していません。コールはフォールバックサービスに直接ヒットします。

私はこのクライアントを削除し、&をマイクロサービス内でテストして正常に動作しています。

私は.ITは私の悪かった問題を解決し、私はこの問題に

答えて

0

を解決するために助けてください。問題は私の構成にあります。同じことを訂正した。 "値"の代わりに "名前"を使用しました。

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

これは私に役立ちます。

関連する問題