This service must record incoming idempotency keys in an internal database (can be file system based - redis/memcached would be better).
The constructor for the idempotency store must take in the name of the service it is storing idempotency keys for - and the keys need to be scoped per service so that the same idempotency key received by two services do not conflict with each other.
Idempotency keys should be cleared out after a specific period of time - 5 minutes (? this is an assumption, is this correct?).
This service needs to provide two methods:
keyExists(key) → returns true/false if the key already exists within the store
addKey(key) → adds the key to the store if it does not already exist
Create a new shared idempotency store.
This service must record incoming idempotency keys in an internal database (can be file system based - redis/memcached would be better).
The constructor for the idempotency store must take in the name of the service it is storing idempotency keys for - and the keys need to be scoped per service so that the same idempotency key received by two services do not conflict with each other.
Idempotency keys should be cleared out after a specific period of time - 5 minutes (? this is an assumption, is this correct?).
This service needs to provide two methods: