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 497ddc51..2483a8b3 100644 --- a/core/src/main/java/io/temporal/samples/nexus/README.MD +++ b/core/src/main/java/io/temporal/samples/nexus/README.MD @@ -11,7 +11,7 @@ This sample shows how to use Temporal for authoring a Nexus service and call it ### Sample directory structure -- [service](./service) - shared service defintion +- [service](./service) - shared service definition - [caller](./caller) - caller workflows, worker, and starter - [handler](./handler) - handler workflow, operations, and worker - [options](./options) - command line argument parsing utility @@ -68,8 +68,8 @@ deployments with server version 1.25.0. ### Make Nexus calls across namespace boundaries -> Instructions apply for local development, for Temporal Cloud or a self hosted setups, supply the relevant [CLI -> flags](./options/cli.go) to properly set up the connection. +> Instructions apply for local development, for Temporal Cloud or a self-hosted setups, supply the relevant [CLI +> flags](./options/ClientOptions.java) to properly set up the connection. In separate terminal windows: diff --git a/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java b/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java index 19c0d7e0..23dd0f5e 100644 --- a/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java +++ b/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java @@ -39,14 +39,14 @@ public static void main(String[] args) { client.newWorkflowStub(EchoCallerWorkflow.class, workflowOptions); logger.info("Workflow result: {}", echoWorkflow.echo("Nexus Echo 👋")); logger.info( - "Started workflow workflowId: {} runId; {}", + "Started workflow workflowId: {} runId: {}", WorkflowStub.fromTyped(echoWorkflow).getExecution().getWorkflowId(), WorkflowStub.fromTyped(echoWorkflow).getExecution().getRunId()); HelloCallerWorkflow helloWorkflow = client.newWorkflowStub(HelloCallerWorkflow.class, workflowOptions); logger.info("Workflow result: {}", helloWorkflow.hello("Nexus", NexusService.Language.ES)); logger.info( - "Started workflow workflowId: {} runId; {}", + "Started workflow workflowId: {} runId: {}", WorkflowStub.fromTyped(helloWorkflow).getExecution().getWorkflowId(), WorkflowStub.fromTyped(helloWorkflow).getExecution().getRunId()); } diff --git a/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java b/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java index 3f7442d0..e7be0ae4 100644 --- a/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java +++ b/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java @@ -25,6 +25,7 @@ import io.temporal.worker.WorkerFactory; import io.temporal.worker.WorkflowImplementationOptions; import io.temporal.workflow.NexusServiceOptions; +import java.util.Collections; public class CallerWorker { public static final String DEFAULT_TASK_QUEUE_NAME = "my-caller-workflow-task-queue"; @@ -37,8 +38,10 @@ public static void main(String[] args) { Worker worker = factory.newWorker(DEFAULT_TASK_QUEUE_NAME); worker.registerWorkflowImplementationTypes( WorkflowImplementationOptions.newBuilder() - .setDefaultNexusServiceOptions( - NexusServiceOptions.newBuilder().setEndpoint("my-nexus-endpoint-name").build()) + .setNexusServiceOptions( + Collections.singletonMap( + "NexusService", + NexusServiceOptions.newBuilder().setEndpoint("my-nexus-endpoint-name").build())) .build(), EchoCallerWorkflowImpl.class, HelloCallerWorkflowImpl.class);