Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036536Retail ModulesWeb POSpublic2017-07-27 10:062017-08-04 15:07
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR17Q4RR17Q4 
marvintm
No
0036536: Store response for external order loader and resend if duplicate message is received
When using the external order loader it is possible that the response is not received by the caller.

The caller can then decide to repeat the order request (as no response was received).

However this can result a duplicate message, creating orders twice or more times for example.
Simulate a simple duplicate request:
Put a breakpoint in the orderloader
Run tomcat in debug mode
Run one of the simple test cases [1] to call the external orderloader
The system stops at the breakpoint
Run the same test case again
Breakpoint is hit second time

Although this is not strictly a duplicate request it provides the idea.

[1]
https://code.openbravo.com/tools/automation/pi-mobile/file/0451be809da3/src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/RetailOrderLoaderTest.java [^]
- store the response for each request in the c_import_entry table in a new column. Do this at generic level as other calls can also benefit from this.
- also store the error response
- in the externalorderloader detect if a message was already processed/error, if so return the response
- in the externalorderloader detect if a message is already being processed, if so wait a certain amount of time and then return the response. Make this wait time configurable. If after this time no response was generated throw an error.
No tags attached.
related to feature request 00365373.0PR17Q4 closed mtaal Openbravo ERP Store the response of an action also in c_import_entry 
related to defect 0036323 closed mtaal Retail Modules When the server is processing a message still then do not execute success or failure on the client 
related to feature request 0036538 closed mtaal Retail Modules MultiServerJSONProcess: When a message from the webpos is duplicated send the original response 
Issue History
2017-07-27 10:06mtaalNew Issue
2017-07-27 10:06mtaalAssigned To => mtaal
2017-07-27 10:06mtaalTriggers an Emergency Pack => No
2017-07-27 10:11mtaalRelationship addedrelated to 0036537
2017-07-27 10:13mtaalRelationship addedrelated to 0036323
2017-07-27 10:19mtaalRelationship addedrelated to 0036538
2017-08-01 18:55hgbotCheckin
2017-08-01 18:55hgbotNote Added: 0098316
2017-08-01 18:58hgbotCheckin
2017-08-01 18:58hgbotNote Added: 0098317
2017-08-01 18:58hgbotStatusnew => resolved
2017-08-01 18:58hgbotResolutionopen => fixed
2017-08-01 18:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/64587bc76040df4e005363f22f566a6dff1e8bbf [^]
2017-08-01 18:58hgbotCheckin
2017-08-01 18:58hgbotNote Added: 0098318
2017-08-01 19:06mtaalReview Assigned To => migueldejuana
2017-08-01 19:06mtaalNote Added: 0098319
2017-08-04 15:07marvintmReview Assigned Tomigueldejuana => marvintm
2017-08-04 15:07marvintmStatusresolved => closed
2017-08-04 15:07marvintmFixed in Version => RR17Q4

Notes
(0098316)
hgbot   
2017-08-01 18:55   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: e3cb74a79b0d55d8717b040b0ea2294d96676679
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 01 18:54:41 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/e3cb74a79b0d55d8717b040b0ea2294d96676679 [^]

Related to issue 36536: Store response for external order loader and resend if duplicate message is received
Move the success/error response code to separate method to make them overridable by external order loader

---
M src/org/openbravo/mobile/core/process/DataSynchronizationProcess.java
---
(0098317)
hgbot   
2017-08-01 18:58   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 64587bc76040df4e005363f22f566a6dff1e8bbf
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 01 18:57:38 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/64587bc76040df4e005363f22f566a6dff1e8bbf [^]

Fixes issue 36536: Store response for external order loader and resend if duplicate message is received
Before executing external order loader check if there is already a result. If so then return previous
result. If the system is still processing then wait a specific time before proceeding.

Added a preference to control the processing wait time.

Also provide an error handler to store the correct error result.

---
M src-db/database/sourcedata/AD_REF_LIST.xml
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
M src/org/openbravo/retail/posterminal/ExternalOrderLoaderErrorHandler.java
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0098318)
hgbot   
2017-08-01 18:58   
Repository: tools/automation/pi-mobile
Changeset: 720084ebb29f3fe4bdada841a949a50e4e358ada
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 01 18:58:15 2017 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/720084ebb29f3fe4bdada841a949a50e4e358ada [^]

Related to issue 36536: Store response for external order loader and resend if duplicate message is received
Added testcases for the external order loader duplicate message handling

---
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/BaseRetailOrderLoaderTest.java
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/RetailOrderLoaderTest.java
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-multiorder-1.json
---
(0098319)
mtaal   
2017-08-01 19:06   
Documentation:
http://wiki.openbravo.com/wiki/Retail:Order_Loading_WebService#Handling_duplicate_messages [^]