728x90
반응형
서비스 중에 특정 시간대에 db가 튀어 connection이 매일 같은 시간에 끊어지는 에러가 발생하여 이벤트를 SQS로 보내고 에러를 처리하는 람다에 트리거를 걸었다.
하지만 에러는 15개가 났는데 정상적으로 처리된건 3건에 불과했다.
15개가 에러나면 트리거 걸어둔 람다 모니터링에 15번 실행 될줄 알았지 ...
로그를 다시 확인해보니 큐가 한번에 여러개 들어왔다...
로그를 제대로 확인 안해본 내 잘못이지...
코드도 보니 리스트 중 1번만 처리하게 해놨으니..
{
"Records":
[
{
"messageId": "",
"receiptHandle": "",
"body": "{error event}",
"attributes": {
"ApproximateReceiveCount": "",
"SentTimestamp": "",
"SenderId": "",
"ApproximateFirstReceiveTimestamp": ""
},
"messageAttributes": {},
"md5OfBody": "",
"eventSource": "aws:sqs",
"eventSourceARN": "",
"awsRegion": "ap-northeast-2"
},
{
"messageId": "",
"receiptHandle": "",
"body": "{error event}",
"attributes": {
"ApproximateReceiveCount": "",
"SentTimestamp": "",
"SenderId": "",
"ApproximateFirstReceiveTimestamp": ""
},
"messageAttributes": {},
"md5OfBody": "",
"eventSource": "aws:sqs",
"eventSourceARN": "",
"awsRegion": "ap-northeast-2"
},
...
]
}
이런식으로 ..
728x90
반응형
'개발 > AWS' 카테고리의 다른 글
AWS-EC2에 gitlab 띄우기 (0) | 2022.07.18 |
---|---|
AWS aws-vault (0) | 2022.05.20 |
AWS DMS VPC 보조 CIDR (0) | 2022.05.19 |
AWS Lambda serverless v3 version up (0) | 2022.05.12 |
AWS-SHELL / awscli (0) | 2022.05.12 |