Skip to content

Commit

Permalink
Add MessageAttributeNames to receive input of sqs
Browse files Browse the repository at this point in the history
  • Loading branch information
sefasenturk95 committed Oct 26, 2021
1 parent 8231a4e commit ea421cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cmd/example-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package main
import (
"context"
"fmt"
"os"

"github.com/Sef1995/go-sqs-poller/worker"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/h2ik/go-sqs-poller/v3/worker"
"os"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/h2ik/go-sqs-poller/v3
module github.com/Sef1995/go-sqs-poller

require (
github.com/aws/aws-sdk-go v1.6.18
Expand Down
3 changes: 3 additions & 0 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func (worker *Worker) Start(ctx context.Context, h Handler) {
AttributeNames: []*string{
aws.String("All"), // Required
},
MessageAttributeNames: []*string{
aws.String(sqs.QueueAttributeNameAll),
},
WaitTimeSeconds: aws.Int64(worker.Config.WaitTimeSecond),
}

Expand Down
3 changes: 3 additions & 0 deletions worker/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,8 @@ func buildClientParams() *sqs.ReceiveMessageInput {
MaxNumberOfMessages: aws.Int64(maxNumberOfMessages),
AttributeNames: []*string{aws.String("All")},
WaitTimeSeconds: aws.Int64(waitTimeSecond),
MessageAttributeNames: []*string{
aws.String(sqs.QueueAttributeNameAll),
},
}
}

0 comments on commit ea421cc

Please sign in to comment.