Skip to content

Commit

Permalink
Expose SQS message ID (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-dunn-sublime authored Jun 24, 2024
1 parent ec43948 commit 9450dc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions v1/brokers/sqs/sqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ func (b *Broker) consumeOne(delivery *awssqs.ReceiveMessageOutput, taskProcessor
sig.SQSReceiptHandle = *delivery.Messages[0].ReceiptHandle
}

if delivery.Messages[0].MessageId != nil {
sig.SQSMessageID = *delivery.Messages[0].MessageId
}

if receiveCount := delivery.Messages[0].Attributes[awssqs.MessageSystemAttributeNameApproximateReceiveCount]; receiveCount != nil {
if rc, err := strconv.ParseInt(*receiveCount, 10, 64); err == nil {
sig.AttemptCount = int(rc) - 1 // SQS receive count includes this attempt, but AttemptCount goes from 0
Expand Down
4 changes: 2 additions & 2 deletions v1/tasks/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ type Signature struct {
ChordCallback *Signature
//MessageGroupId for Broker, e.g. SQS
BrokerMessageGroupId string
//ReceiptHandle of SQS Message
SQSReceiptHandle string
SQSReceiptHandle string
SQSMessageID string

AzureMessageID string
AzurePopReceipt string
Expand Down

0 comments on commit 9450dc5

Please sign in to comment.