How it works · Trajectories

One header, a different path through the system

A trajectory is a name carried in a request header. Each service declares what it does differently on that trajectory, configuration adds its own values for it, every policy can see it, and outgoing calls pass it on. Remove the header and the request takes the main path again.

A trajectory: one header that changes beans and values along a whole request A quote request arrives with a trajectory named pricing-v2, either in a header or derived from the tenant by a pre-processor. The trajectory is copied into the request context, where every policy can see it. The service reference step swaps the pricing service for its pricing-v2 variant; configuration lookups layer the pricing-v2 values over the base and tenant ones; and the call to the inventory service carries the header, so inventory applies its own override. Without a trajectory, every step takes the main path. ClientPOST /quote chenile-highwaycopy x- headers trajectory mappertenant acme → pricing-v2 policiesevery interceptor sees it constructServiceReferencemock › trajectory › selector › default PricingServiceImplpricingService PricingServiceV2pricing-v2 only cconfig · module "pricing" · later layers win pricing.jsondiscount 5% acme/pricing.jsoncurrency INR pricing-v2/pricing.jsondiscount 8% acme/pricing-v2/…(none) effective: discount 5% inventory proxyx-chenile-trajectory-id travels inventory · another deployable InventoryServiceImpldefault ReserveV2its own override the quote, built by the chosen beans and values no trajectory
trajectory from
view
Step 1

Exchange

Payload

Chosen by anything

The caller can name the trajectory, or a pre-processor can derive it from a tenant, a region or a slice of traffic. Everything after that sees the same header.

Declared where it matters

Services declare their own variants with @ConditionalOnTrajectory, configuration adds a trajectory layer, and workflows can follow it. Whatever declares nothing takes its main path.

Easy to measure, easy to end

Policies can tag logs and metrics with the trajectory to compare it with the main path. Ending the experiment means removing a header mapping, a module and a configuration folder.