Temporal Nexus is a new feature of the Temporal platform designed to connect durable executions across team, namespace, region, and cloud boundaries. It promotes a more modular architecture for sharing a subset of your team’s capabilities via well-defined service API contracts for other teams to use, that abstract underlying Temporal primitives, like Workflows, or execute arbitrary code.
Learn more at temporal.io/nexus.
This sample shows how to use Temporal for authoring a Nexus service and call it from a workflow.
- service - shared service definition
- caller - caller workflows, worker, and starter
- handler - handler workflow, operations, and worker
- options - command line argument parsing utility
- Follow the instructions on the docs site to install Temporal CLI.
NOTE: The recommended version is at least v1.3.0.
HTTP port is required for Nexus communications
temporal server start-dev
In a separate terminal window
temporal operator namespace create --namespace my-target-namespace
temporal operator namespace create --namespace my-caller-namespace
temporal operator nexus endpoint create \
--name my-nexus-endpoint-name \
--target-namespace my-target-namespace \
--target-task-queue my-handler-task-queue \
--description-file ./core/src/main/java/io/temporal/samples/nexus/service/description.md
Nexus is currently available as Public Preview.
Self hosted users can try Nexus out in single cluster deployments with server version 1.25.0.
Instructions apply for local development, for Temporal Cloud or a self-hosted setups, supply the relevant CLI flags to properly set up the connection.
In separate terminal windows:
./gradlew -q execute -PmainClass=io.temporal.samples.nexus.handler.HandlerWorker \
--args="-target-host localhost:7233 -namespace my-target-namespace"
./gradlew -q execute -PmainClass=io.temporal.samples.nexus.caller.CallerWorker \
--args="-target-host localhost:7233 -namespace my-caller-namespace"
./gradlew -q execute -PmainClass=io.temporal.samples.nexus.caller.CallerStarter \
--args="-target-host localhost:7233 -namespace my-caller-namespace"
which should result in:
[main] INFO i.t.s.nexus.caller.CallerStarter - Workflow result: Nexus Echo 👋
[main] INFO i.t.s.nexus.caller.CallerStarter - Workflow result: ¡Hola! Nexus 👋