亚马逊MWS API中的RequestThrottling问题

Aru*_*ana 14 amazon amazon-mws

在C#中测试亚马逊MWS API的 API样本用于提交提要,但是在设置AWS密钥,访问密钥等代码后我收到了RequestThrottled的错误,所以有详细信息是什么,但找不到任何代码示例如何解决了这一点

我想将feed.xml上传到amazon卖家帐户

  <?xml version="1.0" encoding="iso-8859-1"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>M_EXAMPLE_123456</MerchantIdentifier>
  </Header>
  <MessageType>Product</MessageType>
  <PurgeAndReplace>true</PurgeAndReplace>
  <Message>
    <MessageID>1</MessageID>
    <OperationType>Insert</OperationType>
    <Product>
      <SKU>56789</SKU>
      <StandardProductID>
        <Type>ASIN</Type>
        <Value>B0EXAMPLEG</Value>
      </StandardProductID>
      <ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
      <DescriptionData>
        <Title>Example Product Title</Title>
        <Brand>Example Product Brand</Brand>
        <Description>This is an example product description.</Description>
        <BulletPoint>Example Bullet Point 1</BulletPoint>
        <BulletPoint>Example Bullet Point 2</BulletPoint>
        <MSRP currency="USD">25.19</MSRP>
        <Manufacturer>Example Product Manufacturer</Manufacturer>
        <ItemType>example-item-type</ItemType>
      </DescriptionData>
      <ProductData>
        <Health>
          <ProductType>
            <HealthMisc>
              <Ingredients>Example Ingredients</Ingredients>
              <Directions>Example Directions</Directions>
            </HealthMisc>
          </ProductType>
        </Health>
      </ProductData>
    </Product>
  </Message>
</AmazonEnvelope>
Run Code Online (Sandbox Code Playgroud)

如下所示出错

 Caught Exception: Request from SubmitFeed:AKIAJI4PSK4HXY6UCNMA;A2DNAGZJ1EWQLW is
 throttled.
Response Status Code: ServiceUnavailable
Error Code: RequestThrottled
Error Type: Sender
Request ID: fc59c802-04da-4dd3-89a8-db5f525cac39
XML: <ErrorResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/"><Error><Typ
e>Sender</Type><Code>RequestThrottled</Code><Message>Request from SubmitFeed:AKI
AJI4PSK4HXY6UCNMA;A2DNAGZJ1EWQLW is throttled.</Message><Detail>System.Object</D
etail></Error><RequestId>fc59c802-04da-4dd3-89a8-db5f525cac39</RequestId></Error
Response>
Run Code Online (Sandbox Code Playgroud)

谁能给我解决方案来解决这个问题?

谢谢!

hyp*_*ean 26

根据亚马逊的API参考,SubmitFeed操作的最大请求限额为15,每2分钟恢复一次请求.这意味着您可以在15次爆发时调用此操作,但在此之后您将被限制2分钟,直到亚马逊允许您再次发出请求.你可以在他们的开发者指南中找到更好的解释,他们会更好地描述他们如何使用leaky bucket algorithm.

可能你的Feed没有任何问题,但是因为你提出的请求太多(可能超过15个)你受到了限制.我的建议是建立你的代码以这样一种方式,你考虑到亚马逊throttlening并具有当你被掐死了一个退避算法(如走过了"还原率"期间回来后,具体的给你打电话的类型'干嘛).此外,请记住,MWS的另一个限制是在所有类型的呼叫中每小时10000个请求.