Copper Workflow switch and Error Retry

66 views
Skip to first unread message

Akash S

unread,
Nov 14, 2022, 10:57:12 AM11/14/22
to COPPER Engine
Hello Respected,

I will be using workflows for our project instead of scheduled batch and trying to incorporate Copper.

I am trying to find example and build a proof of concept on Workflow switching . As in, when a certain api is called and it takes long time, Copper will save its status and Copper can meanwhile call a 2nd one and then continue with response with 2nd one. When 1st one response comes back, Copper will resume state of first one. 
Below is a code I saw on Copper official tutorial under HelloworldWorkflowV2: 

@Override
public void main) throws Interrupt {
final String correlation = HelLoWorldAdapter.get().asyncSendHelloWorld(getData());
final String correlationId2 = HelLoWorldAdapter.get().asyncSendHelLoWorLd(getData());
logger.info(correlationId + ": workflow version2: Hello World!") ;
wait(WaitMode.FIRST, timeoutMsec: 5 * 60 * 60 * 1000, correlationId, correlationId2) ;
Response<HelloWorldResponse> response = getAndRemoveResponse (correlationId);
if (response == null) {
response = getAndRemoveResponse (correlationId2) ;
}

This code used Transient Engine. During wait(FIRST) method, how do we know which correlation response came first. Also as seen above, if 1st response is null, we take 2nd response but further later 1st response is considered or not? 
Can Transient Engine save state and resume workflows/jobs ? 


And regarding Persistent Engines, when wait() is called, how to see which database table it will store. Or upon savepoint(). 

Do we have Retry mechanism from these engines which automatically retry calls/transactions if there is a failure due to api failure or also due to system shutdown. 

Regards

Reply all
Reply to author
Forward
0 new messages