Add Durable Task middleware support
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- java
研究方向
先閱讀連結的跨 SDK 中介軟體規格和 .NET 使用者指南,然後檢查此 Java SDK 中的 durable worker/builder API。使用提議的 orchestration 和 activity 中介軟體進入點來對應設計,包括內容功能和驗證規則。實作列出的驗收測試、文件以及 host 功能整合,且不進行 wire 或 protobuf 變更,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Summary
Track adding SDK-level Durable Task middleware support to the Java SDK, aligned with the .NET reference implementation.
Reference spec: https://github.com/microsoft/durabletask-dotnet/blob/feature/durable-task-middleware/doc/cross-sdk-middleware.md
.NET user guide: https://github.com/microsoft/durabletask-dotnet/blob/feature/durable-task-middleware/doc/durable-task-middleware.md
Motivation: https://github.com/Azure/azure-functions-durable-extension/issues/3054
The spec may shift until the .NET v1 implementation is merged. This issue is intended to track the Java design and implementation work so it can follow the same durable middleware contract with idiomatic API names.
Proposed shape
Names are illustrative, not final API commitments.
workerBuilder.useOrchestrationMiddleware((ctx, next) -> {
if (!ctx.isReplaying()) {
logger.info("starting orchestration {}", ctx.getInstanceId());
}
return next.invoke(ctx);
});
workerBuilder.useActivityMiddleware((ctx, next) -> {
Optional<Object> cached = cache.tryGet(ctx.getName(), ctx.getInput());
if (cached.isPresent()) {
ctx.setResult(cached.get());
return CompletableFuture.completedFuture(null);
}
return next.invoke(ctx);
});
Design points to cover
- Builder-level registration APIs for orchestration and activity middleware.
- Registration ordering: first registered middleware runs outermost and unwinds last.
- Context interfaces that expose durable task name, instance ID, version/parent/tags where available, input, raw input where available, replay state for orchestrations, features, and result after
next. - A feature collection keyed by
Class<T>or another type-safe Java abstraction. - Integration with dependency injection frameworks where present, without requiring a particular DI container.
- Orchestration middleware determinism guidance for replay, including replay-safe logging and avoiding nondurable
CompletableFuture/threading usage, wall-clock time, random values, file/network I/O, and mutable process state. - Activity middleware short-circuiting through an explicit
setResultAPI. - Host integration pattern for Azure Functions or other hosts to attach invocation context through features instead of durable middleware depending on host middleware internals.
Acceptance criteria
- Orchestration and activity middleware APIs are exposed at the durable worker/builder level.
- Middleware executes in registration order and unwinds in reverse order.
- Orchestration middleware must call
next.invoke(ctx)exactly once when completing successfully; missing or duplicate calls are rejected where feasible. - Activity middleware can call
next.invoke(ctx)once or short-circuit only throughctx.setResult(...); duplicatenextis invalid. - Host-specific objects can be passed through features without serialization into durable history.
- Documentation covers replay determinism and the difference between durable middleware and host/Functions middleware.
- Tests cover registration ordering, context population, feature access, orchestration next-call validation, and activity short-circuiting.
- No wire protocol or protobuf changes are required.
- Entity middleware is out of scope for v1.
- 主要語言
- Java
- 星號
- 29
- 分支
- 18
- 平均合併
- 54 分鐘
- 30 天內合併 PR
- 1
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/durabletask-java 的其他 Issue
-
Needs: Triage :mag:
難度 4/5 3-5 天 新手友好度 48/100
microsoft/durabletask-java#303 ·
-
Needs: Triage :mag:
難度 4/5 3-5 天 新手友好度 45/100
microsoft/durabletask-java#290 · 2 則留言 ·
-
Needs: Triage :mag:
難度 3/5 1-2 天 新手友好度 68/100
microsoft/durabletask-java#276 ·
-
Wrap gRPC StatusRuntimeException across all client and worker gRPC calls可能重新可做 @bachuv 於 171 天前認領,目前沒有進行中的 PR。 未關閉Enhancement
microsoft/durabletask-java#274 · 1 個 reaction · 已指派 2 人 ·
-
Needs: Triage :mag:
難度 4/5 3-5 天 新手友好度 42/100
microsoft/durabletask-java#270 ·
查看 microsoft/durabletask-java 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
termux/termux-app#5340 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
apache/rocketmq-dashboard#5110 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 4 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
bug javascript
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆