天天看點

Openfeign ErrorDecoder caused java.io.IOException: stream is closed

實作錯誤解碼器,保留 feign 服務異常資訊,左側是之前設計的。偶爾下遊系統出現異常時,拿到傳回結果時,居然會是stream is closed,就找了下原因。

Don't use any of the above feature before get the 

response.body()

就是因為使用log來輸出日志,内部關閉了輸入流。

詳細解析可以看 https://stackoverflow.com/questions/61472139/openfeign-errordecoder-caused-java-io-ioexception-stream-is-closed

Openfeign ErrorDecoder caused java.io.IOException: stream is closed