func deleteMessage(svc *sqs.SQS, msgs ...*sqs.Message) error { // delete messages delParams := sqs.DeleteMessageInput{ QueueUrl: queueURL, } for i, msg := range msgs { delParams.ReceiptHandle = msg.ReceiptHandle _, err := svc.DeleteMessage(&delParams) if err != nil { return err } fmt.Printf("message deleted %v: %v\n", i, *msg.Body) } return nil }
func delete_message(svc *sqs.SQS, queue_url *string, receipt_handle *string) error { params := &sqs.DeleteMessageInput{ QueueUrl: queue_url, ReceiptHandle: receipt_handle, } _, err := svc.DeleteMessage(params) if err != nil { return err } return nil }
func deleteMessage(svc *sqs.SQS, queueURL string, receiptHandle string) error { params := &sqs.DeleteMessageInput{ QueueUrl: aws.String(queueURL), // Required ReceiptHandle: aws.String(receiptHandle), // Required } _, err := svc.DeleteMessage(params) if err != nil { return err } return nil }
func delete(qUrl string, svc *sqs.SQS, dx chan string) { for { m := <-dx params := &sqs.DeleteMessageInput{ QueueUrl: aws.String(qUrl), // Required ReceiptHandle: aws.String(m), // Required } _, err := svc.DeleteMessage(params) if err != nil { log.Println("WARN - problem deleting messages from SQS, continuing.") } } }