Skip to content

Commit

Permalink
Update to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Dec 5, 2024
1 parent 9416847 commit 4102533
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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,)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package io.temporal.opentracing;

import io.nexusrpc.handler.OperationContext;
import io.temporal.common.interceptors.*;
import io.temporal.opentracing.internal.*;

Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package io.temporal.common.interceptors;

import io.nexusrpc.handler.OperationContext;
import io.temporal.common.Experimental;

/**
Expand Down Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -33,7 +35,7 @@ public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInt

@Override
public NexusOperationInboundCallsInterceptor interceptNexusOperation(
NexusOperationInboundCallsInterceptor next) {
OperationContext context, NexusOperationInboundCallsInterceptor next) {
return next;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ public TemporalInterceptorMiddleware(WorkerInterceptor[] interceptors) {

@Override
public OperationHandler<Object, Object> intercept(
OperationHandler<Object, Object> operationHandler) {
OperationContext context, OperationHandler<Object, Object> operationHandler) {
rootInboundCallsInterceptor = new RootNexusOperationInboundCallsInterceptor(operationHandler);
NexusOperationInboundCallsInterceptor inboundCallsInterceptor = rootInboundCallsInterceptor;
for (WorkerInterceptor interceptor : interceptors) {
inboundCallsInterceptor = interceptor.interceptNexusOperation(inboundCallsInterceptor);
inboundCallsInterceptor =
interceptor.interceptNexusOperation(context, inboundCallsInterceptor);
}

inboundCallsInterceptor.init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -132,7 +133,7 @@ public ActivityInboundCallsInterceptor interceptActivity(ActivityInboundCallsInt

@Override
public NexusOperationInboundCallsInterceptor interceptNexusOperation(
NexusOperationInboundCallsInterceptor next) {
OperationContext context, NexusOperationInboundCallsInterceptor next) {
return new TracingNexusOperationInboundCallsInterceptor(trace, next);
}

Expand Down

0 comments on commit 4102533

Please sign in to comment.