microsoft / microsoft/durabletask-java

Incorrect retry count returned in case of Activity Function

Open
#167 4 comments 0 reactions 1 assignee View on GitHub

@kaibocai is already working on this.

Since Sep 27, 2023.

Enhancement need investigation P2
Dominant language
Java
Stars
29
Forks
18
Avg merge
1d 10h
Merged PRs (30d)
2

Description

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));

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.