Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

Idempotency for cosmos db java client as it is using http protocol #295

Open bhukailas opened 4 years ago

bhukailas commented 4 years ago

Let's say there is a document with the following JSON structure.

{ "name": "fernandez", "age": 46 }

Now, Azure cosmos DB makes a post request and at the server end the document is created successfully., But the response is not proper due to transient errors in the network. Now If the client retries there a duplicate document gets created. This means Cosmos db needs to provide idempotency for creating documents.

Currently, I do not find any header which takes idempotency key from clients.