polishing previous commit

This commit is contained in:
Oleg Zhurakousky
2023-01-17 11:09:54 +01:00
parent 38b41dcd3e
commit 079234b021

View File

@@ -43,6 +43,7 @@ import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
@@ -147,20 +148,20 @@ public final class CustomRuntimeEventLoop implements SmartLifecycle {
.format(LAMBDA_INVOCATION_URL_TEMPLATE, runtimeApi, LAMBDA_VERSION_DATE, requestId);
String traceId = response.getHeaders().getFirst("Lambda-Runtime-Trace-Id");
if (traceId != null) {
if (StringUtils.hasText(traceId)) {
if (logger.isDebugEnabled()) {
logger.debug("Lambda-Runtime-Trace-Id: " + traceId);
}
try {
// The X-Ray SDK uses this value to connect trace data between services.
System.setProperty("com.amazonaws.xray.traceHeader", traceId);
} catch (Exception e) {
}
catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to set amazon x-ray trace id", e);
}
}
}
try {
Message<byte[]> responseMessage = (Message<byte[]>) function.apply(eventMessage);