From ad307e55edb76b4eea7d84fa4ce57d48a4160542 Mon Sep 17 00:00:00 2001 From: Aman Date: Mon, 28 Aug 2017 13:49:47 +0530 Subject: [PATCH 1/2] Add more informative logs --- cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 4b4dae6..ea153dd 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -175,7 +175,7 @@ func startConsumer(queue Queue) { ReceiptHandle: msg.ReceiptHandle, }) if err != nil { - log.Fatalf(err.Error()) + log.Fatalf("%s: Error while deleting processes message from SQS: %s", queue.Name, err.Error()) } } } @@ -192,7 +192,7 @@ func startPoller(queue Queue) { func pollSQS(queue Queue) { resp, err := svc.ReceiveMessage(queue.msgparams) if err != nil { - log.Fatalf(err.Error()) + log.Fatalf("%s: Error while reading message from SQS: %s", queue.Name, err.Error()) } for _, msg := range resp.Messages { From 166c2ee86552e0742ee180946b3d4e957ca72dc8 Mon Sep 17 00:00:00 2001 From: Aman Date: Mon, 28 Aug 2017 14:34:07 +0530 Subject: [PATCH 2/2] Bug fix in queue url --- cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index ea153dd..02443c4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -171,11 +171,11 @@ func startConsumer(queue Queue) { for msg := range queue.sem { if sendMessageToURL(*msg.Body, queue) { _, err := svc.DeleteMessage(&sqs.DeleteMessageInput{ - QueueUrl: &queue.URL, + QueueUrl: queue.msgparams.QueueUrl, ReceiptHandle: msg.ReceiptHandle, }) if err != nil { - log.Fatalf("%s: Error while deleting processes message from SQS: %s", queue.Name, err.Error()) + log.Fatalf("%s: Error while deleting processed message from SQS: %s", queue.Name, err.Error()) } } }