Skip to main content

Port Conventions

Angzarr uses consistent port numbering across all deployment modes.


Infrastructure Ports

Core framework services use fixed ports:

ServicePortNodePortDescription
Aggregate Coordinator131031310Per-domain command handling
Stream gRPC134031340Event streaming
Topology REST API9099-Topology visualization

Business Logic Port Scheme

Business logic services use a ten-port-per-pod scheme for consistent addressing.

Each pod uses a base port (e.g., 50050, 50060) with offsets 0-9:

OffsetPurposeExposedDescription
0Coordinator gRPCYesAngzarr sidecar coordinator
1REST ProxyOptionalREST → gRPC proxy
2Coordinator DebugNoSidecar diagnostics
3Client LogicNoInternal sidecar-to-logic
4Client DebugNoLogic diagnostics
5-8ReservedNoFuture use
9Control/Meta UIOptionalAdmin UI, metrics

Port Ranges by Language

Each language gets a distinct range for concurrent local development:

LanguageBase RangeAggregatesSagasProjectors
Rust50050-5019950050-5010950110-5013950140-50159
Go50200-5034950200-5025950260-5028950290-50309
Python50400-5054950400-5045950460-5048950490-50509
Java50550-5069950550-5060950610-5063950640-50659
C#50700-5084950700-5075950760-5078950790-50809
C++50850-5099950850-5090950910-5093950940-50959

Example: Rust Aggregates

ServiceBaseCoordinatorRESTDebugLogic
Player5005050050500515005250053
Table5006050060500615006250063
Hand5007050070500715007250073

Design Rationale

Why ten ports?

  1. Coordinator (offset 0) — Primary gRPC endpoint. Always exposed.
  2. REST Proxy (offset 1) — Optional HTTP/REST for non-gRPC clients.
  3. Coordinator Debug (offset 2) — Health checks, metrics for sidecar.
  4. Client Logic (offset 3) — Internal sidecar-to-logic. Never exposed externally.
  5. Client Debug (offset 4) — Logic debugging during development.
  6. Reserved (5-8) — Future expansion without restructuring.
  7. Control UI (offset 9) — Optional admin interface.

Why separate ranges per language?

  • Run all six implementations simultaneously for comparison testing
  • Prevent port conflicts during local development
  • Clear ownership when debugging multi-language deployments

Kubernetes Considerations

In Kubernetes, container ports are typically remapped:

# values.yaml
applications:
business:
- name: player
ports:
coordinator: 50050 # Exposed via Service
rest: 50051 # Exposed if REST needed
debug: 50052 # Exposed only if needed
# Logic port (50053) stays internal to pod

The mesh/ingress routes to the coordinator port (offset 0). Internal sidecar-to-logic communication uses localhost within the pod.


Environment Variables

VariableDefaultDescription
PORTvariesCoordinator gRPC port (offset 0)
REST_PORTPORT+1REST proxy port (offset 1)
DEBUG_PORTPORT+2Debug endpoint port (offset 2)
TARGET_PORTPORT+3Client logic port (offset 3)

Next Steps