[JAVA][FEIGN] Put back hardcoded HTTP Client but without the performance issue created in 8484. This is fix for 21187 (#22905)

* BUG:21187 put back hardcoded client without the issue created in 8484

* BUG:21187 put back hardcoded client without the issue created in 8484

---------

Co-authored-by: Sri Sushma Karra <srisushmakarra@Sris-MacBook-Air.local>
This commit is contained in:
Sri Sushma Karra
2026-02-07 00:48:00 +08:00
committed by GitHub
parent 07d60e010a
commit 459f359bf4
5 changed files with 36 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import feign.RequestInterceptor;
import feign.form.FormEncoder;
import feign.gson.GsonDecoder;
import feign.gson.GsonEncoder;
import feign.okhttp.OkHttpClient;
import feign.slf4j.Slf4jLogger;
import org.openapitools.client.auth.HttpBasicAuth;
import org.openapitools.client.auth.HttpBearerAuth;
@@ -40,10 +41,12 @@ public class ApiClient {
protected String basePath = "http://localhost:3000";
protected Map<String, RequestInterceptor> apiAuthorizations;
protected Feign.Builder feignBuilder;
private static final OkHttpClient OK_HTTP_CLIENT = new OkHttpClient();
public ApiClient() {
apiAuthorizations = new LinkedHashMap<String, RequestInterceptor>();
feignBuilder = Feign.builder()
.client(OK_HTTP_CLIENT)
.encoder(new FormEncoder(new GsonEncoder()))
.decoder(new GsonDecoder())
.logger(new Slf4jLogger());