microsoft / microsoft/durabletask-java
Incorrect retry count returned in case of Activity Function
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.