Ability to specify activity timeouts via annotation in Java SDK

Offen
#2,051 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
32/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java

Rechercherichtung

Beginne damit nachzuverfolgen, wie @ActivityInterface, @ActivityMethod, @MethodRetry, Activity-Stubs und WorkflowImplementationOptions derzeit das Retry- und Timeout-Verhalten festlegen. Vergleiche die Rangfolge auf Methoden- und Stub-Ebene und definiere und teste anschließend eine annotationsbasierte API, die Start-to-close- und Schedule-to-close-Timeouts ohne Zeichenketten für Activity-Namen unterstützt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

Is your feature request related to a problem? Please describe.
In the Java SDK, you have an @ActivityInterface with multiple @ActivityMethods. The latter is the actual unit of execution. However, you specify retry and timeout options on the activity stub, which is based on the interface, so in order to have specific config for each activity you have to go out of your way and break up the interface into small pieces, which kinda defeats one of the nicest features of Temporal which is to just program your service as if it were native code. You can configure specific settings per method, but you have to use strings for activity names instead of strongly typed constructs, and still the activity-stub level config takes precedence.

Recently, I became aware of the @MethodRetry annotation, which is great, but it only allows you to specify retry options, not timeouts, so it falls short of addressing the basic issue.

Describe the solution you'd like
Either an additional set of parameters in @MethodRetry or a new annotation (e.g. @ActivityTimeouts) that allows me to specify activity timeouts (start-to-close and schedule-to-close) at the method level.

Describe alternatives you've considered
Specifying per-activity config using WorkflowImplementationOptions, but you have to use strings for activity names instead of strongly typed constructs, and still the activity-stub level config takes precedence.

Additional context
N/A.

Vorherrschende Sprache
Java
Sterne
447
Forks
278
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
28

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus temporalio/sdk-java

Alle Issues in temporalio/sdk-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.