Skip to content

Commit

Permalink
Fix nexus sample TLS settings (temporalio#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns authored and steveandroulakis committed Oct 28, 2024
1 parent cb93bfb commit f40e832
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/io/temporal/samples/nexus/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f40e832

Please sign in to comment.