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

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?