From 72fd4a482765d5199ce834a094f414378fd7ffd8 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Fri, 18 Oct 2024 11:15:59 -0700 Subject: [PATCH] Fix nexus sample TLS settings (#688) --- core/src/main/java/io/temporal/samples/nexus/README.MD | 2 +- .../io/temporal/samples/nexus/options/ClientOptions.java | 5 ++--- .../java/io/temporal/samples/nexus/service/description.md | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/io/temporal/samples/nexus/README.MD b/core/src/main/java/io/temporal/samples/nexus/README.MD index 2483a8b3..526d3d48 100644 --- a/core/src/main/java/io/temporal/samples/nexus/README.MD +++ b/core/src/main/java/io/temporal/samples/nexus/README.MD @@ -54,7 +54,7 @@ temporal operator nexus endpoint create \ --name my-nexus-endpoint-name \ --target-namespace my-target-namespace \ --target-task-queue my-handler-task-queue \ - --description-file ./service/description.md + --description-file ./core/src/main/java/io/temporal/samples/nexus/service/description.md ``` ## Getting started with a self-hosted service or Temporal Cloud diff --git a/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java b/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java index 49d0dde2..95e6d121 100644 --- a/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java +++ b/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java @@ -19,6 +19,7 @@ package io.temporal.samples.nexus.options; +import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; import io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder; import io.grpc.netty.shaded.io.netty.handler.ssl.util.InsecureTrustManagerFactory; import io.temporal.client.WorkflowClient; @@ -27,13 +28,11 @@ import io.temporal.serviceclient.WorkflowServiceStubsOptions; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.util.Arrays; import javax.net.ssl.SSLException; import org.apache.commons.cli.*; public class ClientOptions { public static WorkflowClient getWorkflowClient(String[] args) { - System.out.println(Arrays.toString(args)); Options options = new Options(); Option targetHostOption = new Option("target-host", true, "Host:port for the Temporal service"); targetHostOption.setRequired(false); @@ -107,7 +106,7 @@ public static WorkflowClient getWorkflowClient(String[] args) { if (insecureSkipVerify) { sslContext.trustManager(InsecureTrustManagerFactory.INSTANCE); } - serviceStubOptionsBuilder.setSslContext(sslContext.build()); + serviceStubOptionsBuilder.setSslContext(GrpcSslContexts.configure(sslContext).build()); } catch (SSLException e) { throw new RuntimeException(e); } catch (FileNotFoundException e) { diff --git a/core/src/main/java/io/temporal/samples/nexus/service/description.md b/core/src/main/java/io/temporal/samples/nexus/service/description.md index 74eb4d88..98dc2708 100644 --- a/core/src/main/java/io/temporal/samples/nexus/service/description.md +++ b/core/src/main/java/io/temporal/samples/nexus/service/description.md @@ -1,8 +1,8 @@ Service Name: -my-hello-service +NexusService Operation Names: echo -say-hello +hello Input / Output arguments are in the following repository: https://github.com/temporalio/samples-java/core/src/main/java/io/temporal/samples/nexus/service/NexusService.java