Is there any special configuration needed for @ExponentialRetry in AWS FlowFramework of SWF?

0

I am using @ExponentialRetry on the activity, but it is not retrying the activity. Here is my code in Intellij IDEA.

This is my Activities interface

@ExponentialRetry(
    initialRetryIntervalSeconds = 5,
    exceptionsToRetry = IllegalStateException.class,
    maximumAttempts = 5)
String printHello();

Implementation class:

private boolean check = true;   // on the class level

@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";
}

This is my Workflow implementation class from where I am calling this activity through the activities client, means workflow entry point

@Override
public void helloWorld() {
    handleUnreliableActivity();
}

private void handleUnreliableActivity() {
    new TryCatch() {
        @Override
        protected void doTry() throws Throwable {
            Promise<String> result = client.printHello();
            client.printBye(result);
        }

        @Override
        protected void doCatch(Throwable throwable) throws Throwable {
            System.out.println("In doCatch  **************************");
            throw throwable;
        }
    };
}

Can anyone help?

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠