Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Oct 16, 2024
1 parent 1470cd2 commit a908df2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/io/temporal/samples/nexus/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
Expand Down

0 comments on commit a908df2

Please sign in to comment.