-
Notifications
You must be signed in to change notification settings - Fork 62
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
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 |
||
| 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. | ||
|
||
|
|
||
| ## 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` | ||
|
||
| - **Python**: `CallbackError` for callback failures | ||
|
||
| - **Java**: `CallbackTimeoutException`, `CallbackFailedException`, `WaitForConditionFailedException` | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a complete list. Will agents be able to discover them all with this hint or we have to list all the operations and exceptions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed Java exception types in SKILL.md