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条)

报告相同问题?

悬赏问题

  • ¥15 python结合Matlab仿真忆阻器
  • ¥35 有人会注册whatsaop协议号吗?
  • ¥15 lead dbs 无法导入影像数据
  • ¥15 多目标MPA算法优化编程实现
  • ¥15 反激PWM控制芯片调研
  • ¥15 Python for loop减少运行时间
  • ¥15 fluent模拟物质浓度udf
  • ¥15 Collection contains no element matching the predicate
  • ¥20 冻品电商平台的搜索是怎么实现的
  • ¥15 如何搞一个可以控制、显示马达频率