Appearance
Temporal Payment Example
Optional Temporal integration with flux aggregates and the command bus. Demonstrates a durable Workflow outside the native workflow.Orchestrator (that path remains available for prototypes and PoCs—see E-Commerce).
Source: example/temporal-payment.
What it shows
- Split processes:
cmd/workerandcmd/demo(place-order/pay-order/status) - Domain-first layout (
internal/sales/…,internal/workflows/payment/) per Project Layout - Workflows pass
event.EventReference; activities useEventStore.Find - Payment confirmation via Temporal signal (
pay-order); timeout cancels - Shared Redis Event Store across worker and demo
- Optional OpenTelemetry (Temporal
opentelemetry-v2plugin +fluxotel+ envelope/activity bridge) with Jaeger in local compose go testvia Temporaltestsuitewithout Docker
Run tests
bash
cd example/temporal-payment
go test ./...Run against Temporal
bash
cd example/temporal-payment
docker compose up -d
export EVENTSTORE_REDIS_ADDR=localhost:6379
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
go run ./cmd/worker # terminal 1
go run ./cmd/demo place-order
go run ./cmd/demo pay-order --order-id 'urn:shop:demo:orders:1:order:…'See the example README for ports (Temporal UI :8080, Jaeger UI :16686, OTLP :4318), and teardown.
Related guides
- Workflows & Temporal — native + optional Temporal conventions
- Instrumentation & Observability — traces, metrics, and OTLP logs
- Projections — native vs Temporal cursors
