Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eed7525

Browse files
Revert "Unblock UseExisting conflict policy for Nexux WorkflowRunOperation (#2440)"
This reverts commit 0ee60c0.
1 parent fe4d0db commit eed7525

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

temporal-sdk/src/main/java/io/temporal/internal/common/InternalUtils.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222

2323
import com.google.common.base.Defaults;
2424
import io.nexusrpc.Header;
25+
import io.nexusrpc.handler.HandlerException;
2526
import io.nexusrpc.handler.ServiceImplInstance;
2627
import io.temporal.api.common.v1.Callback;
2728
import io.temporal.api.enums.v1.TaskQueueKind;
29+
import io.temporal.api.enums.v1.WorkflowIdConflictPolicy;
2830
import io.temporal.api.taskqueue.v1.TaskQueue;
2931
import io.temporal.client.OnConflictOptions;
3032
import io.temporal.client.WorkflowOptions;
@@ -35,6 +37,7 @@
3537
import io.temporal.internal.client.NexusStartWorkflowRequest;
3638
import java.util.Arrays;
3739
import java.util.Map;
40+
import java.util.Objects;
3841
import java.util.TreeMap;
3942
import java.util.stream.Collectors;
4043
import org.slf4j.Logger;
@@ -152,6 +155,16 @@ public static WorkflowStub createNexusBoundStub(
152155
.setAttachCompletionCallbacks(true)
153156
.build());
154157

158+
// TODO(klassenq) temporarily blocking conflict policy USE_EXISTING.
159+
if (Objects.equals(
160+
WorkflowIdConflictPolicy.WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING,
161+
options.getWorkflowIdConflictPolicy())) {
162+
throw new HandlerException(
163+
HandlerException.ErrorType.INTERNAL,
164+
new IllegalArgumentException(
165+
"Workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation."),
166+
HandlerException.RetryBehavior.NON_RETRYABLE);
167+
}
155168
return stub.newInstance(nexusWorkflowOptions.build());
156169
}
157170

temporal-sdk/src/test/java/io/temporal/workflow/nexus/WorkflowHandleUseExistingOnConflictCancelTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.UUID;
3939
import org.junit.*;
4040

41+
@Ignore("Skipping until we can support USE_EXISTING")
4142
public class WorkflowHandleUseExistingOnConflictCancelTest {
4243
@Rule
4344
public SDKTestWorkflowRule testWorkflowRule =

temporal-sdk/src/test/java/io/temporal/workflow/nexus/WorkflowHandleUseExistingOnConflictTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.UUID;
3737
import org.junit.*;
3838

39+
@Ignore("Skipping until we can support USE_EXISTING")
3940
public class WorkflowHandleUseExistingOnConflictTest {
4041
@Rule
4142
public SDKTestWorkflowRule testWorkflowRule =

0 commit comments

Comments
 (0)