Skip to content

Commit

Permalink
Merge pull request #66 from foodora/sqs-message-id-getter
Browse files Browse the repository at this point in the history
Add MessageID getter to Message struct
  • Loading branch information
Muharem Ismailov committed Jul 16, 2019
2 parents 2b6f1bd + 529bc71 commit 0aa606e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pubsub/awssub/sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ func (m *subscriberMessage) String() string {
return msgBody
}

// returns original sqs message id
func (m *subscriberMessage) GetMessageId() string {
if m.message.MessageId == nil {
return ""
}
return *m.message.MessageId
}

// ExtendDoneDeadline changes the visibility timeout of the underlying SQS
// message. It will set the visibility timeout of the message to the given
// duration.
Expand Down
1 change: 1 addition & 0 deletions pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ type Message interface {
String() string
ExtendDoneDeadline(time.Duration) error
Done() error
GetMessageId() string
}

0 comments on commit 0aa606e

Please sign in to comment.