At-Least-Once Delivery
최소 한 번 배송
최소 한 번 배송은 메시지가 손실되지 않도록 시도하지만, 동일한 메시지가 여러 번 도착할 수 있습니다. 소비자는 반복을 안전하게 처리해야 합니다.
deliver -> process -> acknowledge/delete; missing acknowledgement -> redeliver; event ID -> dedupeevt_784deliver -> process -> acknowledge/delete; missing acknowledgement -> redeliver; event ID -> dedupeJOB다른 예시
한 워커가 영수증 `evt-42`를 저장했지만 Amazon SQS 메시지를 삭제하기 전에 중단됩니다. 이후 SQS가 동일한 메시지를 다시 전달합니다. 다음 워커는 저장된 이벤트 ID를 확인하고 기존 영수증을 반환하며 두 번째 영수증을 생성하지 않습니다.
주요 부분
- 01안정된 메시지 ID
- 02전달 시도
- 03워커가 만든 결과
- 04확인 또는 삭제
- 05재배달 경로
- 06중복 기록
사용할 때
한 번의 작업 손실이 두 번 처리하는 것보다 더 나쁠 때 이 규칙을 사용하십시오. 모든 메시지에는 안정적인 ID를 부여하십시오. 반복된 메시지는 중복으로 요금 청구, 이메일 발송 또는 저장하지 않아야 합니다.
다음 경우에는 사용하지 마세요
전달이 작업 성공을 의미하지 않습니다. 정확히 하나의 결과를 약속하지 마세요. 요금이나 외부 작업에는 별도의 중복 방지가 필요합니다.
코드에서 사용된 이름
deliver -> process -> acknowledge/delete; missing acknowledgement -> redeliver; event ID -> dedupe 출시하기 전에
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with 최소 한 번 배송 (At-Least-Once Delivery)。 User context:한 워커가 영수증 `evt-42`를 저장했지만 Amazon SQS 메시지를 삭제하기 전에 중단됩니다. 이후 SQS가 동일한 메시지를 다시 전달합니다. 다음 워커는 저장된 이벤트 ID를 확인하고 기존 영수증을 반환하며 두 번째 영수증을 생성하지 않습니다. Technical concept or control:최소 한 번 배송 (At-Least-Once Delivery)。 Why it fits:한 번의 작업 손실이 두 번 처리하는 것보다 더 나쁠 때 이 규칙을 사용하십시오. 모든 메시지에는 안정적인 ID를 부여하십시오. 반복된 메시지는 중복으로 요금 청구, 이메일 발송 또는 저장하지 않아야 합니다. Do not use it when:전달이 작업 성공을 의미하지 않습니다. 정확히 하나의 결과를 약속하지 마세요. 요금이나 외부 작업에는 별도의 중복 방지가 필요합니다. Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):하나의 공식 표준이 전체 용어를 통제하지 않음. 의미는 팀, 플랫폼 또는 프레임워크마다 달라질 수 있음. Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
이 요청을 확인하세요
Review how 최소 한 번 배송 (At-Least-Once Delivery) is used now. Definition: 최소 한 번 배송은 메시지가 손실되지 않도록 시도하지만, 동일한 메시지가 여러 번 도착할 수 있습니다. 소비자는 반복을 안전하게 처리해야 합니다. Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.