You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/utilities/idempotency.md
+25-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,9 @@ The idempotency utility allows you to retry operations within a time window with
18
18
19
19
The property of idempotency means that an operation does not cause additional side effects if it is called more than once with the same input parameters.
20
20
21
-
**Idempotency key** is a combination of **(a)** Lambda function name, **(b)** fully qualified name of your function, and **(c)** a hash of the entire payload or part(s) of the payload you specify.
21
+
<!-- markdownlint-disable MD013 -->
22
+
**Idempotency key** By default, this is a combination of **(a)** Lambda function name, **(b)** fully qualified name of your function, and **(c)** a hash of the entire payload or part(s) of the payload you specify. However, you can customize the key generation by using **(a)** a [custom prefix name](#customizing-the-idempotency-key-generation), while still incorporating **(c)** a hash of the entire payload or part(s) of the payload you specify.
23
+
<!-- markdownlint-enable MD013 -->
22
24
23
25
**Idempotent request** is an operation with the same input previously processed that is not expired in your persistent storage or in-memory cache.
24
26
@@ -356,6 +358,28 @@ You can change this expiration window with the **`expires_after_seconds`** param
356
358
357
359
A record might still be valid (`COMPLETE`) when we retrieved, but in some rare cases it might expire a second later. A record could also be [cached in memory](#using-in-memory-cache). You might also want to have idempotent transactions that should expire in seconds.
358
360
361
+
### Customizing the Idempotency key generation
362
+
363
+
!!! warning "Warning: Changing the idempotency key generation will invalidate existing idempotency records"
364
+
365
+
Use **`key_prefix`** parameter in the `@idempotent` or `@idempotent_function` decorators to define a custom prefix for your Idempotency Key. This allows you to decouple idempotency key name from function names. It can be useful during application refactoring, for example.
0 commit comments