Skip to content

OperatorServiceStubsOptions.validateAndBuildWithDefaults not carrying over grpcMetadataProvider from WorkflowService #2800

@tsurdilo

Description

@tsurdilo

If in WorkflowService we define grpcMetadataProvider

WorkflowServiceStubsOptions options = WorkflowServiceStubsOptions.newBuilder()
    .setTarget(serverAddress)
    .addGrpcMetadataProvider(new AuthorizationGrpcMetadataProvider(tokenSupplier))
    .build();
var service = WorkflowServiceStubs.newServiceStubs(options);

Then create operator service via typcal

  OperatorServiceStubsOptions operatorServiceStubsOptions =
      OperatorServiceStubsOptions.newBuilder()
          .setChannel(service.getRawChannel())
          .validateAndBuildWithDefaults();
  var operatorStub = OperatorServiceStubs.newServiceStubs(operatorServiceStubsOptions).blockingStub();

created operator service does not carry over grpc metadata from service used
user has to explicitly set again:

    OperatorServiceStubsOptions operatorServiceStubsOptions =
      OperatorServiceStubsOptions.newBuilder()
          .setChannel(service.getRawChannel())
          .addGrpcMetadataProvider(new AuthorizationGrpcMetadataProvider(tokenSupplier))
          .validateAndBuildWithDefaults();

request is to carry over this info in ServiceStubOptions.validateAndBuildWithDefaults if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions