After following above document for ExponentialRetry, our activities are not retrying automatically as mentioned in the document.
Is there any other thing needed apart from adding @ExponentialRetry on the Activity method.
@Component
@Setter
public class WorkflowServiceImpl implements IWorkflow {
private String state = "Started";
IMyActivitiesClientImpl client = new IMyActivitiesClientImpl();
@Override
public void start() {
System.out.println("before calling");
this.handleActivity();
System.out.println("after calling");
}
@Override
public String getState() {
System.out.println("state-----" +state);
return state;
}
private void handleActivity(){
Promise<String> result = client.printHello();
client.printBye(result);
}
}
public class MyActivitiesImpl implements IMyActivities {
private boolean check = true;
@Override
public String printHello() {
System.out.println("In activity 1111");
if (check) {
check = false;
System.out.println("121212121");
throw new IllegalStateException("showing this for the first time from this activity");
}
return "Hello World";
}
@Override
public void printBye(String name) {
System.out.println("In activity 2222 " + name);
}
https://docs.aws.amazon.com/amazonswf/latest/awsflowguide/features-retry.html
After following above document for ExponentialRetry, our activities are not retrying automatically as mentioned in the document. Is there any other thing needed apart from adding @ExponentialRetry on the Activity method.
Below is my Sample code-----
@Activities @ActivityRegistrationOptions(defaultTaskScheduleToStartTimeoutSeconds = 30, defaultTaskStartToCloseTimeoutSeconds = 30) public interface IMyActivities {
}
@Workflow @WorkflowRegistrationOptions(defaultExecutionStartToCloseTimeoutSeconds = 60, defaultTaskStartToCloseTimeoutSeconds = 30) public interface IWorkflow {
}
@Component @Setter public class WorkflowServiceImpl implements IWorkflow { private String state = "Started";
}
public class MyActivitiesImpl implements IMyActivities {
}