How can I create a controlled BatchWriteItem fail in DynamoDB?
Basically, I want to have a way of simulating failure (break BatchWriteItem on purpose) in DynamoDB so I can make sure the logic that takes UnprocessedItems in response is working correctly.
From documentation: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
Typically, you would call BatchWriteItem in a loop. Each iteration would check for unprocessed items and submit a new BatchWriteItem request with those unprocessed items until all items have been processed.
Below are two similar solutions discussed that use do-while loop and callback:
JAVA with do-while:
NODE with callback:
How to handle UnprocessedItems using AWS JavaScript SDK (dynamoDB)?
How to prepare a "broken" BatchWriteItem request in order to test this?
Can DynamoDB end up in infinite loop? i.e. BatchWriteItem returns UnprocessedItems, the code takes UnprocessedItems and calls BatchWriteItem and returns UnprocessedItems again and again?