WowAutoConfiguration

@AutoConfiguration(afterName = ["org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration", "org.springframework.boot.mongodb.autoconfigure.MongoAutoConfiguration", "org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration"])
@EnableConfigurationProperties(value = [WowProperties::class])
class WowAutoConfiguration

The Wow host (.3; –): by what the classpath and the application's beans offer, it assembles one ServiceNode and serves it on two ports.

  • Models and Manifest (NodeModels): the binding index on the classpath (ModelProvider.load) of the contexts wow.contexts.include / exclude select (ContextSelection; all by default), the models' parameters from the application's beans (BeanFactoryDependencies), the Manifest merged from the modules' fragments (ManifestLoader, read with WowJson.mapper, never Spring's mapper), and with it the peer contracts on the classpath (ContractDirectory).

  • Backend (NodeStores; wow.backend, BackendSelection; each store opened by the StoreProvider of its type, StoreProviders): PostgreSQL over the application's DataSource, MongoDB over its MongoClient, in memory (one node, with a warning) when wow.backend=memory, or when it has neither and runs in a development profile or on a loopback-only internal port (it refuses to start otherwise), or the application's own BackendFactory bean. With wow.stores, the named store instances instead (StoreInstances), each aggregate's log and snapshots on the store wow.log.store, wow.snapshot.stores and its wow.aggregates.* name (StoreLayout).

  • Admission (NodeAdmission): every CommandAuthorizer bean, all asked in their order, the first denial the answer (CommandAuthorizer.allOf); without one, the public port refuses the system commands of Wow's built-in aggregates, the jobs' and the snapshot rebuild's (403 wow.auth.forbidden); the CommandTransformers and CommandValidators, the Jakarta validator when it has a Bean Validation provider, the id generators: the GlobalIdGenerator bean (UUIDv7 unless the application gives one; wow-cosid gives aggregate ids alone) and, per aggregate type, the AggregateIdGenerator bean wow.aggregates.*.id-generator names, or one an AggregateIdGeneratorSource bean finds by that name, else the wowAggregateIdGenerator bean (the global generator's ids unless replaced); the fixed tenants of wow.aggregates.*.tenant, and wow.wait.default-timeout, the node's default wait timeout for every entry.

  • Ports (NodePublicPort, NodeInternalPort): the public routes (wowRoutes) on the application's WebFlux server, authenticated by its CallerResolver (without one, the development callers in a development profile, the anonymous caller on a loopback-only internal port, and no start elsewhere); the cluster channel and the wait signals (internalRoutes) on an InternalPort of their own at wow.internal.port, never on the public server, the node's address learned once it is bound when the port is 0; HttpClusterChannel and HttpSignalSender share one JDK client. Each request between nodes names the node's service (Wow-Service): a forward is taken from a node of the same service alone, a signal from any service, the origin of a wait that crossed services. No token: the internal port is reachable by the platform's own pods alone, a NetworkPolicy's boundary.

  • Synchronous calls (NodePeers): the sagas call other contexts' gateways through the CommandCaller bean, by default an HttpCommandCaller at wow.peers.<context>.url, the target's internal port, naming this node's service. The internal port serves the command routes of the calls (callRoutes) to the service each call names (DeclaredServices); the public port refuses Wow-Call. A service may call the commands wow.callers.<service>.commands lets it (CallPermits), an optional list that catches a misconfiguration, each authorized by the node's authorizers as every command is.

  • Subscriptions: the annotated processors' handlers the binding indexes list (ModelProvider.processors, built from the application's beans), then every SubscriptionFactory bean, the application's and the modules', in their order, and every PublishedSinks bean (such as the transport sink). Those that read other contexts' published streams read them from the SourceTopics bean (wow-kafka's).

  • Parked entries: retried over the long horizon by wow.subscription.parked.*; every me.ahoo.wow.runtime.subscription.ParkedNotifier bean, the webhook of wow.ops.webhook.* among them, hears when one parks or spends its retries; wow.http.ops.enabled serves the operator's routes (parkedRoutes).

  • Observation: every Observer bean (wow-observability's, ObservabilityAutoConfiguration, and the application's), as one (Observer.of), in their order; nothing does without one.

  • Lifecycle: WowLifecycles.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun wowConfigurationKeys(environment: ConfigurableEnvironment, context: ApplicationContext, providers: StoreProviders, transports: ObjectProvider<TransportProvider>, sinks: ObjectProvider<SinkProvider>, discoveries: ObjectProvider<PeerDiscovery>): ConfigurationKeys

Checks the environment's wow.* keys against the configuration metadata and the options the node's providers declare (wow.<type>.<key>, ProviderOptionKeys) at startup, refusing the unknown ones (ConfigurationKeys).

Link copied to clipboard
fun wowDevelopmentMode(properties: WowProperties, environment: Environment, identity: ObjectProvider<NodeIdentity>): DevelopmentMode

Whether the node runs for development (a profile of wow.dev-profiles, or a loopback internal port): the one exemption of the host's safeguards (DevelopmentMode).

Link copied to clipboard

Lets the public server's graceful shutdown end before the server stops (GracefulShutdownSettled).

Link copied to clipboard
@Bean(value = ["wowJsonMapper"], defaultCandidate = false)
fun wowJsonMapper(): JsonMapper

Wow's JSON mapper; not a default candidate, so Spring's own mapper stays Spring's.

Link copied to clipboard
@Bean
@ConditionalOnMissingBean
fun wowNodeIdentity(properties: WowProperties, environment: Environment): NodeIdentity
Link copied to clipboard

The scope the routes stream their answers in, cancelled once the node and the internal port have stopped.