From 701feed5ba9e705139820e28933125af2240fbdc Mon Sep 17 00:00:00 2001 From: imprity Date: Wed, 20 May 2026 13:18:41 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20elasticsearch=EC=97=90=EB=8F=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EB=90=9C=20=EA=B2=BD=EB=A7=A4=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/example/lambda/AuctionSqsLambda.java | 51 +++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/com/example/lambda/AuctionSqsLambda.java b/src/com/example/lambda/AuctionSqsLambda.java index 9aff9cd..403166e 100644 --- a/src/com/example/lambda/AuctionSqsLambda.java +++ b/src/com/example/lambda/AuctionSqsLambda.java @@ -10,9 +10,15 @@ import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.params.ScanParams; import redis.clients.jedis.resps.ScanResult; + +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -41,6 +47,18 @@ public class AuctionSqsLambda implements RequestHandler resp = httpClient.send(req, HttpResponse.BodyHandlers.ofString()); + + if (resp.statusCode() >= 300) { + context.getLogger().log("[ES] status update 실패: auctionId=%d, code=%d, body=%s".formatted( + auctionId, resp.statusCode(), resp.body())); + } + } catch (Exception e) { + context.getLogger().log("[ES] status update 예외: auctionId=%d, %s".formatted( + auctionId, e.getMessage())); + } + } +}