diff --git a/build.gradle b/build.gradle index 5c5d974af..6b2142711 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ ext { // Platforms grpcVersion = '1.54.1' // [1.38.0,) Needed for io.grpc.protobuf.services.HealthStatusManager jacksonVersion = '2.14.2' // [2.9.0,) - nexusVersion = '0.3.1-SNAPSHOT' // [0.1.0,) + nexusVersion = '0.4.0-SNAPSHOT' // [0.1.0,) // we don't upgrade to 1.10.x because it requires kotlin 1.6. Users may use 1.10.x in their environments though. micrometerVersion = project.hasProperty("edgeDepsTest") ? '1.13.6' : '1.9.9' // [1.0.0,) diff --git a/temporal-opentracing/src/main/java/io/temporal/opentracing/OpenTracingWorkerInterceptor.java b/temporal-opentracing/src/main/java/io/temporal/opentracing/OpenTracingWorkerInterceptor.java index 85b4d6663..3d8f9cd4a 100644 --- a/temporal-opentracing/src/main/java/io/temporal/opentracing/OpenTracingWorkerInterceptor.java +++ b/temporal-opentracing/src/main/java/io/temporal/opentracing/OpenTracingWorkerInterceptor.java @@ -20,6 +20,7 @@ package io.temporal.opentracing; +import io.nexusrpc.handler.OperationContext; import io.temporal.common.interceptors.*; import io.temporal.opentracing.internal.*; @@ -52,7 +53,7 @@ public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInt @Override public NexusOperationInboundCallsInterceptor interceptNexusOperation( - NexusOperationInboundCallsInterceptor next) { + OperationContext context, NexusOperationInboundCallsInterceptor next) { return new OpenTracingNexusOperationInboundCallsInterceptor( next, options, spanFactory, contextAccessor); } diff --git a/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptor.java b/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptor.java index d2caf91c7..2a2897c72 100644 --- a/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptor.java +++ b/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptor.java @@ -20,6 +20,7 @@ package io.temporal.common.interceptors; +import io.nexusrpc.handler.OperationContext; import io.temporal.common.Experimental; /** @@ -106,5 +107,5 @@ public interface WorkerInterceptor { * @return an interceptor that passes all the calls to {@code next} */ NexusOperationInboundCallsInterceptor interceptNexusOperation( - NexusOperationInboundCallsInterceptor next); + OperationContext context, NexusOperationInboundCallsInterceptor next); } diff --git a/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptorBase.java b/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptorBase.java index 5a862e701..b331c4998 100644 --- a/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptorBase.java +++ b/temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkerInterceptorBase.java @@ -20,6 +20,8 @@ package io.temporal.common.interceptors; +import io.nexusrpc.handler.OperationContext; + public class WorkerInterceptorBase implements WorkerInterceptor { @Override public WorkflowInboundCallsInterceptor interceptWorkflow(WorkflowInboundCallsInterceptor next) { @@ -33,7 +35,7 @@ public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInt @Override public NexusOperationInboundCallsInterceptor interceptNexusOperation( - NexusOperationInboundCallsInterceptor next) { + OperationContext context, NexusOperationInboundCallsInterceptor next) { return next; } } diff --git a/temporal-sdk/src/main/java/io/temporal/internal/nexus/TemporalInterceptorMiddleware.java b/temporal-sdk/src/main/java/io/temporal/internal/nexus/TemporalInterceptorMiddleware.java index 201b86b40..abc7bc919 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/nexus/TemporalInterceptorMiddleware.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/nexus/TemporalInterceptorMiddleware.java @@ -36,11 +36,12 @@ public TemporalInterceptorMiddleware(WorkerInterceptor[] interceptors) { @Override public OperationHandler intercept( - OperationHandler operationHandler) { + OperationContext context, OperationHandler operationHandler) { rootInboundCallsInterceptor = new RootNexusOperationInboundCallsInterceptor(operationHandler); NexusOperationInboundCallsInterceptor inboundCallsInterceptor = rootInboundCallsInterceptor; for (WorkerInterceptor interceptor : interceptors) { - inboundCallsInterceptor = interceptor.interceptNexusOperation(inboundCallsInterceptor); + inboundCallsInterceptor = + interceptor.interceptNexusOperation(context, inboundCallsInterceptor); } inboundCallsInterceptor.init( diff --git a/temporal-testing/src/main/java/io/temporal/testing/internal/TracingWorkerInterceptor.java b/temporal-testing/src/main/java/io/temporal/testing/internal/TracingWorkerInterceptor.java index ddd2c7a4e..fb4ec2033 100644 --- a/temporal-testing/src/main/java/io/temporal/testing/internal/TracingWorkerInterceptor.java +++ b/temporal-testing/src/main/java/io/temporal/testing/internal/TracingWorkerInterceptor.java @@ -25,6 +25,7 @@ import com.uber.m3.tally.Scope; import io.nexusrpc.OperationUnsuccessfulException; +import io.nexusrpc.handler.OperationContext; import io.temporal.activity.ActivityExecutionContext; import io.temporal.client.ActivityCompletionException; import io.temporal.common.SearchAttributeUpdate; @@ -132,7 +133,7 @@ public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInt @Override public NexusOperationInboundCallsInterceptor interceptNexusOperation( - NexusOperationInboundCallsInterceptor next) { + OperationContext context, NexusOperationInboundCallsInterceptor next) { return new TracingNexusOperationInboundCallsInterceptor(trace, next); }