-
Notifications
You must be signed in to change notification settings - Fork 91
Added Java SDK support to the AWS Lambda durable functions skill #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
274ec69
84f1c96
3f416c4
5fc42d2
e9e3319
4610811
42d3c52
572d62b
0999e50
1fef81c
fa30677
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ Advanced error handling patterns for durable functions, including timeout handli | |
|
|
||
| **Implementation approach:** | ||
|
|
||
| 1. Use `waitForCallback` (TypeScript) or `wait_for_callback` (Python) with a timeout configuration set in the config argument | ||
| 1. Use `waitForCallback` (TypeScript), `wait_for_callback` (Python), or `ctx.waitForCallback` (Java) with a timeout configuration set in the config argument | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the java reference include the ctx object while the others don't?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the "API Reference Conventions" section I have "Java: Full reference with ctx prefix (e.g., ctx.waitForCallback) since Java uses ctx as the conventional variable name", so it's a documentation convention choice, not a functional difference. I can change that. |
||
| 2. Wrap in try-catch to handle timeout errors | ||
| 3. Check if the error is a timeout | ||
| 4. Implement fallback logic in a step (e.g., escalate to manager, use default value, retry with different parameters) | ||
|
|
@@ -32,7 +32,10 @@ Advanced error handling patterns for durable functions, including timeout handli | |
| 4. Execute fallback operation in a separate step | ||
|
|
||
| **Important limitation:** | ||
| In TypeScript, native setTimeout (and patterns like Promise.race using it) will fail during execution replays. To create a reliable timeout that persists across execution (expands over multi invocations), always use the timeout parameter provided by waitForCallback or waitForCondition | ||
| In TypeScript, native setTimeout (and patterns like Promise.race using it) will fail during execution replays. To create a reliable timeout that persists across execution (expands over multi invocations), always use the timeout parameter provided by waitForCallback or waitForCondition. | ||
|
|
||
| **Java considerations:** | ||
| Java does not have an equivalent to Promise.race for local timeouts within a single invocation. Always use the timeout configuration in `CallbackConfig` or `WaitForConditionConfig` for reliable cross-invocation timeouts. | ||
|
smoell marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Conditional Retry Based on Error Type | ||
|
|
||
|
|
@@ -113,3 +116,9 @@ In TypeScript, native setTimeout (and patterns like Promise.race using it) will | |
| - Callback timeouts - external system didn't respond in time | ||
| - External system delays - service is slow or unresponsive | ||
| - Long-running operations - operation exceeded expected duration | ||
|
|
||
| **Exception types by language:** | ||
|
|
||
| - **TypeScript**: Timeout errors thrown from `waitForCallback` or `waitForCondition` | ||
|
smoell marked this conversation as resolved.
Outdated
|
||
| - **Python**: `CallbackError` for callback failures | ||
|
smoell marked this conversation as resolved.
Outdated
|
||
| - **Java**: `CallbackTimeoutException`, `CallbackFailedException`, `WaitForConditionFailedException` | ||
|
smoell marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.