From 8fb67620202d7c0c08e2b6b492c8931034fc380c Mon Sep 17 00:00:00 2001 From: mosidev Date: Mon, 25 Sep 2023 20:44:47 +0330 Subject: [PATCH] [bug] resolving memory-leak issue related to httpMessageConverter --- .../http/starter/configuration/AbstractFeignConfiguration.java | 3 ++- .../starter/impl/feign/exception/TosanWebServiceException.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/configuration/AbstractFeignConfiguration.java b/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/configuration/AbstractFeignConfiguration.java index bb02729..8495362 100644 --- a/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/configuration/AbstractFeignConfiguration.java +++ b/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/configuration/AbstractFeignConfiguration.java @@ -156,7 +156,8 @@ public Decoder feignDecoder(HttpMessageConverter httpMessageConverter) { public HttpMessageConverter httpMessageConverter(ObjectMapper objectMapper) { MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(objectMapper); - messageConverters = () -> new HttpMessageConverters(mappingJackson2HttpMessageConverter); + HttpMessageConverters httpMessageConverters = new HttpMessageConverters(mappingJackson2HttpMessageConverter); + messageConverters = () -> httpMessageConverters; return mappingJackson2HttpMessageConverter; } diff --git a/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/impl/feign/exception/TosanWebServiceException.java b/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/impl/feign/exception/TosanWebServiceException.java index ccee955..7cac731 100644 --- a/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/impl/feign/exception/TosanWebServiceException.java +++ b/tosan-httpclient-spring-boot-starter/src/main/java/com/tosan/client/http/starter/impl/feign/exception/TosanWebServiceException.java @@ -8,6 +8,7 @@ * @since 1/22/2021 */ public abstract class TosanWebServiceException extends Exception implements TosanWebServiceBaseException { + private static final long serialVersionUID = 7501000302649392364L; private Map errorParam; private String message;