已經向我展示了如何分別使用和屬性向webflux:inbound-gateway和webflux:outbound-gateway宣告添加自定義編解碼器。如何將 HttpMessageWriter<> 添加到 webflux 出站網關codec-configurerweb-client
有沒有辦法(甚至可能是一種簡單的方法)將自定義編解碼器添加到默認編解碼器串列中,從而避免在端點中宣告這些?
uj5u.com熱心網友回復:
見CodecConfigurerFactory。您可以使用CodecConfigurer.properties檔案為這些編解碼器指定自定義策略:
# Default CodecConfigurer implementation classes for static Client/ServerCodecConfigurer.create() calls.
# Not meant to be customized by application developers; simply instantiate custom impl classes instead.
org.springframework.http.codec.ClientCodecConfigurer=org.springframework.http.codec.support.DefaultClientCodecConfigurer
org.springframework.http.codec.ServerCodecConfigurer=org.springframework.http.codec.support.DefaultServerCodecConfigurer
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/530903.html
標籤:春天弹簧集成spring-webflux反应式编解码器
上一篇:如何將java物件序列化為字串?
