diff --git a/cmd/example-worker/main.go b/cmd/example-worker/main.go index 3053f0b..aef1727 100644 --- a/cmd/example-worker/main.go +++ b/cmd/example-worker/main.go @@ -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() { diff --git a/go.mod b/go.mod index 82bed98..f8db52d 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/worker/worker.go b/worker/worker.go index 93e2a7a..cfd5a56 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -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), } diff --git a/worker/worker_test.go b/worker/worker_test.go index a85b417..bc029b7 100644 --- a/worker/worker_test.go +++ b/worker/worker_test.go @@ -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), + }, } }