elnafateh commented on code in PR #5674:
URL: https://github.com/apache/fineract/pull/5674#discussion_r2972197653


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/DeterministicIdempotencyKeyGenerator.java:
##########
@@ -0,0 +1,49 @@
+package org.apache.fineract.commands.service;
+
+
+import org.apache.fineract.commands.domain.CommandWrapper;
+import org.springframework.stereotype.Component;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.util.Base64;
+
+@Component
+public class DeterministicIdempotencyKeyGenerator {

Review Comment:
   Good point.
   
   The intention was not to replace the existing command structure, but to 
enhance the current idempotency handling when no idempotency key is provided by 
the client.
   
   From my understanding, the current implementation generates a new 
idempotency key when one is not provided. This works for internal retry 
scenarios, but introduces an issue for external retries (e.g., network 
failures), where the same request is re-sent without an idempotency key and 
ends up being processed multiple times.
   
   This PR attempts to address that specific gap by ensuring that identical 
requests within a short time window resolve to the same idempotency key, 
allowing the existing DB-level uniqueness constraint and command processing 
flow to handle deduplication correctly.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to