-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove publicKey lazy initialization and add Feign response coder config
- Loading branch information
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...-service/src/main/kotlin/com/michibaum/admin_service/security/FeignResponseCoderConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.michibaum.admin_service.security | ||
|
||
import feign.codec.Decoder | ||
import feign.codec.Encoder | ||
import org.springframework.beans.factory.ObjectFactory | ||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters | ||
import org.springframework.cloud.openfeign.support.SpringDecoder | ||
import org.springframework.cloud.openfeign.support.SpringEncoder | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
|
||
/** | ||
* https://github.com/spring-cloud/spring-cloud-openfeign/issues/235 | ||
* fanticat opened this issue on Oct 22, 2019 · 10 comments | ||
*/ | ||
@Configuration | ||
class FeignResponseCoderConfig { | ||
|
||
private val messageConverters = ObjectFactory { HttpMessageConverters() } | ||
|
||
@Bean | ||
fun feignEncoder(): Encoder { | ||
return SpringEncoder(messageConverters) | ||
} | ||
|
||
@Bean | ||
fun feignDecoder(): Decoder { | ||
return SpringDecoder(messageConverters) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters