Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #85 from tiki/release/add-dlq
Browse files Browse the repository at this point in the history
feat: Add DLQ for Ocean Metadata queue
  • Loading branch information
timoguin committed Mar 4, 2024
2 parents 384ac70 + 45fd11a commit a8bee56
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
types:
- closed
- synchronize

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down
58 changes: 56 additions & 2 deletions infra/function/template.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Core Ocean Iceberg Metadata Function
Expand Down Expand Up @@ -32,6 +33,25 @@ Resources:
ContentBasedDeduplication: true
DeduplicationScope: messageGroup
FifoQueue: true
FifoThroughputLimit: perMessageGroupId
MessageRetentionPeriod: 604800
RedrivePolicy:
deadLetterTargetArn: !GetAtt DeadLetterQueue.Arn
maxReceiveCount: 5

DeadLetterQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Sub "${QueueName}-DLQ.fifo"
ContentBasedDeduplication: true
DeduplicationScope: messageGroup
FifoQueue: true
FifoThroughputLimit: perMessageGroupId
MessageRetentionPeriod: 604800
RedriveAllowPolicy:
redrivePermission: byQueue
sourceQueueArns:
- !Sub "arn:aws:sqs:${AWS::Region}:${AWS::AccountId}:${QueueName}.fifo"

Function:
Type: AWS::Serverless::Function
Expand All @@ -46,6 +66,10 @@ Resources:
Tracing: Active
SnapStart:
ApplyOn: PublishedVersions
LoggingConfig:
LogFormat: JSON
ApplicationLogLevel: TRACE
SystemLogLevel: DEBUG
Environment:
Variables:
AWS_LAMBDA_EXEC_WRAPPER: "/opt/otel-sqs-handler"
Expand Down Expand Up @@ -86,10 +110,40 @@ Resources:
Layers:
- !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:${UtilsName}:${UtilsVersion}"
- !Sub "arn:aws:lambda:${AWS::Region}:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-30-0:1"

Outputs:
Function:
Description: Lambda Arn
Description: ARN of the Lambda function
Value: !GetAtt Function.Arn

FunctionArn:
Description: ARN of the Lambda function
Value: !GetAtt Function.Arn

Queue:
Description: SQS Arn
Description: ARN of the SQS queue for metadata events
Value: !GetAtt Queue.Arn

QueueArn:
Description: ARN of the SQS queue for metadata events
Value: !GetAtt Queue.Arn

QueueName:
Description: Name of the SQS queue for metadata events
Value: !GetAtt Queue.QueueName

QueueUrl:
Description: URL of the SQS queue for metadata events
Value: !GetAtt Queue.QueueUrl

DeadLetterQueueArn:
Description: ARN of the DLQ for metadata events
Value: !GetAtt DeadLetterQueue.Arn

DeadLetterQueueName:
Description: Name of the DLQ for metadata events
Value: !GetAtt DeadLetterQueue.QueueName

DeadLetterQueueUrl:
Description: URL of the DQL for metadata events
Value: !GetAtt DeadLetterQueue.QueueUrl
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.mytiki</groupId>
<artifactId>core-iceberg-metadata</artifactId>
<version>0.1.11</version>
<version>0.2.0</version>
<packaging>jar</packaging>
<name>Iceberg Metadata</name>
<properties>
Expand Down

0 comments on commit a8bee56

Please sign in to comment.