duanmaduan1848 2016-07-15 21:19
浏览 46
已采纳

AWS-SDK:SQS如何识别未在BatchDeleteOperation中删除的消息

deleteMessagesParams := &sqs.DeleteMessageBatchInput{
        Entries:  messagesToDelete, // array of type *sqs.DeleteMessageBatchRequestEntry
        QueueUrl: aws.String(QUEUE_URL),
}

if resp , err := svc.DeleteMessageBatch(deleteMessagesParams); err != nil {
    log.Println("Batch Delete Failed: ", err.Error())
}else{
     log.Println("Batch Delete Successful: ", resp)
}

I'm using batch delete in SQS. When the batch deletion operation is successful, resp contains the MessageId's of messages for which deletion is successful.

In-case of error or when some messages are not deleted from the queue, will the err contain MessageId's for which batch Deletion failed??

  • 写回答

2条回答 默认 最新

  • douzhong6480 2016-07-15 21:49
    关注

    In case of partial success when performing batch deletes, the service would return a 200 ok and the response object will have two fields Successful and Failed.

    The Failed will have list of "BatchResultErrorEntry" type of objects containing the message ids and reason for failures.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?