Java SDK does not have option to register workflow name statically

オープン
#2,122 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
43/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java

調査の方向性

WorkflowImplementationOptions と、issue に示されているエントリポイント worker.registerWorkflowImplementationTypes から始め、登録時にワークフロー実装型の名前がどのように選択されるかを追跡します。登録で実装に静的なデフォルト名を指定でき、その動作が適切な SDK テストでカバーされ、アノテーションベースの名前との互換性も含まれていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Is your feature request related to a problem? Please describe.
I'm always frustrated when trying to register a Java workflow with a static name. The current option using annotations does not work for our use case. We define proto enums and share them across different apps so they can trigger workflows across apps. For instance, we have:

public interface MyWorkflow {
    @WorkflowMethod(name = "MyStaticWorkflowName")
    void execute();
}

We need a way to set a default workflow implementation type name during registration.

Describe the solution you'd like
A method to register a workflow with a static name during registration using something like:

WorkflowImplementationOptions options = WorkflowImplementationOptions.newBuilder()
        .setDefaultWorkflowImplementationTypeName(Workflows.WORKFLOWS_SEND_SUBMISSION.name())
        .build();

worker.registerWorkflowImplementationTypes(options, SendSubmissionWorkflowImpl.class);

This would allow us to define workflows that can be triggered across different apps with a shared static name.

Describe alternatives you've considered
Currently, the alternative is to use the short name of the workflow interface by default. However, this does not meet our needs as we cannot share interfaces across apps written in different languages (Golang, Python). Using annotations alone is insufficient for our scenario.

Additional context
Our apps in Golang and Python cannot share Java interfaces, hence the need for a static name registration method. We currently share these names through protobuf-defined enums which can be built for all apps and envs.

主要言語
Java
スター
447
フォーク
278
平均マージ
3日 22時間
マージ済み PR(30日)
28

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

temporalio/sdk-java のほかの issue

temporalio/sdk-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。