Skip to content

Incorrect retry count returned in case of Activity Function #167

Open
@kanupriya15025

Description

@kanupriya15025

I have an Activity Function which has a retry count set to 3. This is intentionally made to throw an exception and retry. Now, I am trying to get the retry count in the Activity Function but it always returns 0.
Here is a sample code I am trying :

public String aepHTTPPollingOperator(@DurableActivityTrigger(name = "input", dataType = "string") String input,
                        ExecutionContext context) throws JsonMappingException, JsonProcessingException, Exception {

    System.out.println("Context Retry : " + context.getRetryContext().getRetrycount()); //always prints 0
    throw new RuntimeException("test exception")
}

This is how I am calling this activity :

RetryPolicy policy = new RetryPolicy(3, 30);
TaskOptions options = new TaskOptions(policy);
ctx.callActivity("ActivityName", activityInputQO.toString(), options, String.class));

Metadata

Metadata

Assignees

Labels

EnhancementNew feature or requestP2Priority 2need investigationNeed investigation from a maintainer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions