-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Line 45 in a841b39
* Currently there is nothing implemented that decrements the reserved items. This |
" * Currently there is nothing implemented that decrements the reserved items. This would happen, inside this service, in response to an order being shipped."
Following above comments, "in response to an order being shipped", assume below actions are required:
- Decrease the reserved count in state store "reservedStock", say iPad
- Decrease the count of available product (say iPad) in inventory KTable/Topic (Probably publish an event to inventory topic, but there might be latency to refresh to Ktable)
The question: How to ensure two "decreasing" happens in one atomic operation, and not enter into one inconsistent scenario based on these KStream/KTable solution?
- e.g., if last iPad has been shipped, the count in reserviedStore is decreased to 0, but the "Inventory" is not decreased to 0 in one transaction, one new order may be put as "valid" order by no iPad on-sale actually
So one RDS is required for such cases?
Metadata
Metadata
Assignees
Labels
No labels