亚马逊MWS API中的RequestThrottling问题
问题描述:
我正在测试Amazon MWS API in C# for submit feeds API样本然而,在设置AWS Secret密钥,访问密钥等代码后,我收到了RequestThrottled错误,因此详细信息是什么但找不到任何代码示例如何解决这个问题。亚马逊MWS API中的RequestThrottling问题
我想feed.xml上传到亚马逊卖家账户
<?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>
错误获取按如下
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>
谁能给我的解决方案来解决这个?
谢谢!
答
根据Amazon's API referenceSubmitFeed
操作具有15的最大请求配额和每2分钟请求的恢复速率。这意味着你可以在15分钟内打电话给这个操作,但是在这之后你会被扼杀2分钟,直到亚马逊允许你提出另一个请求。 你可以在他们的developer guide中找到更好的解释,他们更好地描述了他们如何使用leaky bucket algorithm
。
可能您的Feed没有任何问题,但是因为您提出的请求太多(可能超过15个),所以您会受到限制。我的建议是以这样一种方式构建代码,即考虑到亚马逊的节制,并在受到限制时采用回退算法(例如,在“恢复速度”期间之后回来,具体针对您的通话类型正在做)。另外,请记住MWS的另一个限制是所有类型呼叫的每小时10000个请求。
更好的文档链接(即不是PDF):[SubmitFeed](http://docs.developer.amazonservices.com/en_ES/feeds/Feeds_SubmitFeed.html)和[Throttling Explanation](http://docs.developer。 amazonservices.com/en_ES/dev_guide/DG_Throttling.html) – drzaus