示例#1
1
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
}
示例#2
0
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
}
示例#3
0
文件: sqs.go 项目: porcup/ngproxy
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
}
示例#4
0
文件: sqs.go 项目: GeoNet/haz
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.")
		}

	}
}