Spaced
Declares whether an aggregate is spaced. Since 9.3.0.
A spaced aggregate takes a space from its commands: the command factory writes the command's space (for HTTP, the Wow-Space-Id header; it adds no path segment), the aggregate checks it against the space it was created in, and its queries are scoped by the space a request states. A command to any other aggregate carries the default space whatever its source (HTTP, a saga reacting to a spaced aggregate's event, in-process), and that aggregate neither checks nor records a command's space.
The annotation's presence is the declaration: @Spaced declares a spaced aggregate, @Spaced(false) declares one that is not. Without it anywhere in the aggregate's hierarchy, the deprecated @AggregateRoute(spaced = …) still applies, and an aggregate that declares neither is not spaced. With it, the nearest class that declares the policy in either form decides, so @Spaced(false) on an aggregate overrides @Spaced or @AggregateRoute(spaced = true) on its supertype. Both forms on the same class with different values fail at startup and, under the Wow KSP processor, at compile time.
@AggregateRoot
@Spaced
class Order(private val state: OrderState)Parameters
whether the aggregate is spaced. Defaults to true.