http extra 로그 중복 오류 처리 retry 시 logseq+1
This commit is contained in:
+3
@@ -428,9 +428,12 @@ public abstract class HttpClient5AdapterServiceSupport implements HttpClientAdap
|
|||||||
this.client = HttpClients.custom()
|
this.client = HttpClients.custom()
|
||||||
.disableDefaultUserAgent()
|
.disableDefaultUserAgent()
|
||||||
.disableContentCompression()
|
.disableContentCompression()
|
||||||
|
.disableRedirectHandling() // redirect 자동 재전송 비활성화
|
||||||
|
.disableAutomaticRetries() // 429 포함 자동 재시도 비활성화
|
||||||
.addRequestInterceptorLast(requestLogInterceptor)
|
.addRequestInterceptorLast(requestLogInterceptor)
|
||||||
.addResponseInterceptorFirst(responseLogInterceptor)
|
.addResponseInterceptorFirst(responseLogInterceptor)
|
||||||
.setConnectionManager(connectionManager)
|
.setConnectionManager(connectionManager)
|
||||||
|
.evictExpiredConnections()
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
@@ -12,6 +12,7 @@ import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
|
|||||||
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
|
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
|
||||||
import org.apache.hc.core5.http.protocol.HttpContext;
|
import org.apache.hc.core5.http.protocol.HttpContext;
|
||||||
|
|
||||||
|
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
||||||
import com.eactive.eai.common.util.Logger;
|
import com.eactive.eai.common.util.Logger;
|
||||||
|
|
||||||
|
|
||||||
@@ -72,6 +73,16 @@ public class DeadlineAwareRetryExecutor {
|
|||||||
boolean doRetry = false;
|
boolean doRetry = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (attempt > 0) {
|
||||||
|
Integer logProcessNo = (Integer) context.getAttribute(HttpClientAdapterServiceKey.LOG_PROCESS_NO);
|
||||||
|
if (logProcessNo == null || logProcessNo <= 0) {
|
||||||
|
logProcessNo = 200;
|
||||||
|
}
|
||||||
|
logProcessNo++;
|
||||||
|
|
||||||
|
context.setAttribute(HttpClientAdapterServiceKey.LOG_PROCESS_NO, logProcessNo);
|
||||||
|
}
|
||||||
|
|
||||||
response = httpClient.execute(request, context);
|
response = httpClient.execute(request, context);
|
||||||
int status = response.getCode();
|
int status = response.getCode();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user