Skip to content

Commit cff098d

Browse files
committed
Update Java SDK
1 parent dcee476 commit cff098d

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ subprojects {
2828
ext {
2929
otelVersion = '1.30.1'
3030
otelVersionAlpha = "${otelVersion}-alpha"
31-
javaSDKVersion = '1.26.1'
31+
javaSDKVersion = '1.27.0'
3232
camelVersion = '3.22.1'
3333
jarVersion = '1.0.0'
3434
}

core/src/main/java/io/temporal/samples/countinterceptor/SimpleCountWorkerInterceptor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
package io.temporal.samples.countinterceptor;
2121

22+
import io.nexusrpc.handler.OperationContext;
2223
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
24+
import io.temporal.common.interceptors.NexusOperationInboundCallsInterceptor;
2325
import io.temporal.common.interceptors.WorkerInterceptor;
2426
import io.temporal.common.interceptors.WorkflowInboundCallsInterceptor;
2527

@@ -34,4 +36,10 @@ public WorkflowInboundCallsInterceptor interceptWorkflow(WorkflowInboundCallsInt
3436
public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInterceptor next) {
3537
return new SimpleCountActivityInboundCallsInterceptor(next);
3638
}
39+
40+
@Override
41+
public NexusOperationInboundCallsInterceptor interceptNexusOperation(
42+
OperationContext context, NexusOperationInboundCallsInterceptor next) {
43+
return next;
44+
}
3745
}

core/src/main/java/io/temporal/samples/earlyreturn/EarlyReturnClient.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,13 @@ private static void runWorkflowWithUpdateWithStart(WorkflowClient client) {
4949

5050
System.out.println("Starting workflow with UpdateWithStart");
5151

52-
UpdateWithStartWorkflowOperation<TxResult> updateOp =
53-
UpdateWithStartWorkflowOperation.newBuilder(workflow::returnInitResult)
54-
.setWaitForStage(WorkflowUpdateStage.COMPLETED) // Wait for update to complete
55-
.build();
56-
5752
TxResult updateResult = null;
5853
try {
59-
WorkflowUpdateHandle<TxResult> updateHandle =
60-
WorkflowClient.updateWithStart(workflow::processTransaction, txRequest, updateOp);
61-
62-
updateResult = updateHandle.getResultAsync().get();
54+
updateResult =
55+
WorkflowClient.executeUpdateWithStart(
56+
workflow::returnInitResult,
57+
UpdateOptions.<TxResult>newBuilder().build(),
58+
new WithStartWorkflowOperation<>(workflow::processTransaction, txRequest));
6359

6460
System.out.println(
6561
"Workflow initialized with result: "

core/src/main/java/io/temporal/samples/excludefrominterceptor/interceptor/MyWorkerInterceptor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
package io.temporal.samples.excludefrominterceptor.interceptor;
2121

22+
import io.nexusrpc.handler.OperationContext;
2223
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
24+
import io.temporal.common.interceptors.NexusOperationInboundCallsInterceptor;
2325
import io.temporal.common.interceptors.WorkerInterceptor;
2426
import io.temporal.common.interceptors.WorkflowInboundCallsInterceptor;
2527
import java.util.ArrayList;
@@ -49,4 +51,10 @@ public WorkflowInboundCallsInterceptor interceptWorkflow(WorkflowInboundCallsInt
4951
public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInterceptor next) {
5052
return new MyActivityInboundCallsInterceptor(excludeActivityTypes, next);
5153
}
54+
55+
@Override
56+
public NexusOperationInboundCallsInterceptor interceptNexusOperation(
57+
OperationContext context, NexusOperationInboundCallsInterceptor next) {
58+
return next;
59+
}
5260
}

core/src/main/java/io/temporal/samples/retryonsignalinterceptor/RetryOnSignalWorkerInterceptor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
package io.temporal.samples.retryonsignalinterceptor;
2121

22+
import io.nexusrpc.handler.OperationContext;
2223
import io.temporal.common.interceptors.ActivityInboundCallsInterceptor;
24+
import io.temporal.common.interceptors.NexusOperationInboundCallsInterceptor;
2325
import io.temporal.common.interceptors.WorkerInterceptor;
2426
import io.temporal.common.interceptors.WorkflowInboundCallsInterceptor;
2527

@@ -34,4 +36,10 @@ public WorkflowInboundCallsInterceptor interceptWorkflow(WorkflowInboundCallsInt
3436
public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInterceptor next) {
3537
return next;
3638
}
39+
40+
@Override
41+
public NexusOperationInboundCallsInterceptor interceptNexusOperation(
42+
OperationContext context, NexusOperationInboundCallsInterceptor next) {
43+
return next;
44+
}
3745
}

0 commit comments

Comments
 (0)