Class ApplicationProperties
This class delegates to a layered PropertySource, typically obtained from the active
Fluxzero instance. If no context-bound property source is present, it falls
back to a DecryptingPropertySource that wraps the default layered DefaultPropertySource.
Property sources are accessed in a prioritized order:
EnvironmentVariablesSource– highest precedenceSystemPropertiesSourceFluxzeroAdditionalPropertiesSource– extra locations declared withFLUXZERO_CONFIG_LOCATIONSApplicationEnvironmentPropertiesSource– e.g. application-dev.propertiesApplicationPropertiesSource– fallback base configuration from application.propertiesFluxzeroPropertiesSource– Fluxzero-specific SDK defaults from fluxzero.properties or fluxzero.json
Property resolution supports typed access, default values, encryption, and template substitution.
Common usage:
String token = ApplicationProperties.getProperty("FLUXZERO_API_TOKEN");
boolean featureEnabled = ApplicationProperties.getBooleanProperty("my.feature.enabled", true);
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOptional version of the deployed application.static final StringInterceptor input validation override; environment variable FLUXZERO_INTERCEPT_APPLY_ASSERT_CURRENT.static final StringOptional explicit unique client-instance ID.static final StringAnnotation-independent search profile; environment variable FLUXZERO_SEARCH_COLLECTION_VALUES.static final StringApplication delivery default for outgoing SDK operations.static final StringSelects the versioned Fluxzero default behavior profile for applications that do not configure each default explicitly.static final StringRequires exact historical values in Graph views instead of using current DOCUMENT-only values when history is unavailable.static final StringLegacy alias forCLIENT_ID_PROPERTY.static final StringLegacy alias forTASK_ID_PROPERTY.static final StringProperty-aware Model identity selection override.static final StringOptional literal prefix for every persisted logical@Modelname in one application.static final StringIdentity of the platform task that hosts the application. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanResolves interceptor input validation from the active application at configuration time.static booleanassertCurrent(PropertySource source) Resolves interceptor input validation from the owning application's source at configuration time.static booleancollectionValues(PropertySource source) Resolves the search profile once from the owning application's property source.static booleancontainsProperty(String name) Returnstrueif a property with the given name exists.static StringCreates a unique ID for a client instance.static StringcreateClientId(PropertySource propertySource) Creates a unique ID for a client instance from the given property source.static StringdecryptValue(String encryptedValue) Decrypts the given encrypted value using the configuredEncryptionstrategy.static booleandefaultsVersionAtLeast(PropertySource propertySource, LocalDate version) Returns whether the given source opts into behavior introduced on or before the given date.static booleandefaultsVersionAtLeast(LocalDate version) Returns whether the active defaults version opts into behavior introduced on or before the given date.static StringencryptValue(String value) Encrypts the given value using the configuredEncryptionstrategy.static booleangetBooleanProperty(String name) Resolves a boolean property by key, returningfalseif not present.static booleangetBooleanProperty(String name, boolean defaultValue) Resolves a boolean property by key, returning a default if the property is not present.static GuaranteegetDefaultDeliveryGuarantee(PropertySource propertySource) Resolves the application delivery default using the owning component's property source.static LocalDateReturns the active Fluxzero defaults version, ornullwhen compatibility defaults are used.static LocalDategetDefaultsVersion(PropertySource propertySource) Returns the Fluxzero defaults version from the given source, ornullwhen compatibility defaults are used.static EncryptionReturns the currently activeEncryptioninstance.static StringgetFirstAvailableProperty(String... propertyNames) Returns anOptionalcontaining the first non-null property value among the provided property names, if any exist.static IntegergetIntegerProperty(String name) Resolves an integer property by key, ornullif not found.static IntegergetIntegerProperty(String name, Integer defaultValue) Resolves an integer property by key, or returns the given default value if not found.static LonggetLongProperty(String name) Resolves a long property by key, ornullif not found.static LonggetLongProperty(String name, Long defaultValue) Resolves a long property by key, or returns the given default value if not found.static StringgetProperty(String name) Returns the raw string property for the given key, ornullif not found.static StringgetProperty(String name, String defaultValue) Returns the string property value for the given key, or the specified default if not found.static GuaranteegetRequestDeliveryGuarantee(PropertySource propertySource) Resolves request/reply delivery from the sharedDEFAULT_DELIVERY_GUARANTEE_PROPERTY.static StringReturns the configured platform task ID, ornullwhen the application does not run as a known task.static StringgetTaskId(PropertySource propertySource) Returns the platform task ID from the given property source, ornullwhen absent or blank.static booleangraphStrict(PropertySource propertySource) Resolves Graph strictness from the application's own property source.static <T> TmapProperty(String name, Function<String, T> mapper) Maps a property value identified by its name to a desired type using the provided mapping function.static <T> TmapProperty(String name, Function<String, T> mapper, Supplier<T> defaultValueSupplier) Maps a property value identified by its name to a desired type using the provided mapping function.static booleanmodelAliasTargets(PropertySource source) Resolves Model identity selection from the owning application's property source.static StringrequireProperty(String name) Returns the string property for the given key, throwing anIllegalStateExceptionif not found.static StringsubstituteProperties(String template) Substitutes placeholders in the given template using current property values.static PropertiessubstituteProperties(Properties properties) Substitutes placeholders in the properties using current property values.
-
Field Details
-
TASK_ID_PROPERTY
Identity of the platform task that hosts the application. The default environment-variable name isFLUXZERO_TASK_ID;FLUX_TASK_IDremains supported as a legacy alias.- See Also:
-
LEGACY_TASK_ID_PROPERTY
-
CLIENT_ID_PROPERTY
Optional explicit unique client-instance ID. The default environment-variable name isFLUXZERO_CLIENT_ID;FLUX_CLIENT_IDremains supported as a legacy alias.- See Also:
-
LEGACY_CLIENT_ID_PROPERTY
-
APPLICATION_VERSION_PROPERTY
Optional version of the deployed application. When configured, Fluxzero adds the value to the correlation metadata of every outgoing message under$applicationVersion. The default environment-variable alias isFLUXZERO_APPLICATION_VERSION.- See Also:
-
MODEL_NAME_PREFIX_PROPERTY
Optional literal prefix for every persisted logical@Modelname in one application.Fluxzero does not insert a separator. For example, prefix
billingand Model nameInvoiceresolve tobillingInvoice. Applications that share a Runtime namespace can use this to avoid Model-name collisions. Changing the prefix changes durable Model identity and requires an application-managed data transition.- See Also:
-
DEFAULT_DELIVERY_GUARANTEE_PROPERTY
Application delivery default for outgoing SDK operations. The conventional environment variable isFLUXZERO_PUBLISHING_DEFAULT_GUARANTEE. Values areNONE,SENT, andSTORED; an explicit value overrides the SDK major-version default.- See Also:
-
GRAPH_STRICT_PROPERTY
Requires exact historical values in Graph views instead of using current DOCUMENT-only values when history is unavailable. Environment variable:FLUXZERO_MODEL_GRAPH_STRICT. Defaults to false, independently offluxzero.defaults.version. Mutations, assertions and replay always remain strict.- See Also:
-
ASSERT_CURRENT_PROPERTY
Interceptor input validation override; environment variable FLUXZERO_INTERCEPT_APPLY_ASSERT_CURRENT.- See Also:
-
COLLECTION_VALUES_PROPERTY
Annotation-independent search profile; environment variable FLUXZERO_SEARCH_COLLECTION_VALUES.- See Also:
-
MODEL_ALIAS_TARGETS_PROPERTY
Property-aware Model identity selection override. Requires a Runtime advertising identity selection version 1.- See Also:
-
DEFAULTS_VERSION_PROPERTY
Selects the versioned Fluxzero default behavior profile for applications that do not configure each default explicitly.Existing applications can omit this property to keep compatibility defaults. New applications can set a value in
yyyy.MM.ddformat to opt into all default changes introduced on or before that date. Each default can still be overridden by its own dedicated property.Versioned defaults Defaults version Equivalent property Behavior >= 2026.05.20fluxzero.tracking.unconfiguredHandlerConsumerMode = perHandlerHandlers without an explicit consumer get an isolated generated default consumer per handler class, instead of joining the shared application default consumer for the message type. >= 2026.05.21fluxzero.scheduling.periodic.useDefaultInitialDelay = true@Periodicschedules without an explicitinitialDelayuse their natural first deadline: fixed-delay schedules first run afterdelay, and cron schedules first run at the next cron match. UseinitialDelay = 0for an immediate first run.>= 2026.05.25fluxzero.cache.mode = adaptiveThe default aggregate cache uses a count-bounded hard-reference cache. Applications can keep the old behavior with fluxzero.cache.mode = softRef. Tracking caches are not changed by this defaults version and require an explicitfluxzero.tracking.cache.modesetting.>= 2026.06.09fluxzero.aggregate.commitPolicy = async_after_handler_await_after_batch
fluxzero.model.commitPolicy = async_after_handler_await_after_batchAggregates and independent models using their default commit policy start commits after their handlers and wait for all started commits together at the end of the current message batch. Existing aggregate applications can retain compatibility behavior with fluxzero.aggregate.commitPolicy = sync_after_batch. Independent models use the new behavior regardless of the defaults version and can opt out explicitly.>= 2026.06.20fluxzero.tracking.defaultHandlingMode.webrequest = asyncWeb request handlers assigned through default consumers are invoked on worker threads by default. Existing applications can keep synchronous handling with fluxzero.tracking.defaultHandlingMode.webrequest = syncor by configuring the web request default consumer withhandlingMode = SYNC.>= 2026.07.27fluxzero.tracking.unconfiguredHandlerConsumerMode = perPackageHandlers without an explicit consumer share one generated consumer per exact handler package and message type. Explicit class/package consumers and custom configurations remain more specific. >= 2026.08.04fluxzero.auth.useUserIdMetadata = trueAbstractUserProviderwrites$systemfor the system user andUser.id()for regular users. It resolves$systemto the system user and other values throughgetUserById. Existing applications can keep serialized user objects withfluxzero.auth.useUserIdMetadata = false.>= 2026.08.26fluxzero.web.defaultRedirectPolicy = SAME_ORIGINOutbound web requests using RedirectPolicy.DEFAULTonly follow redirects within the original scheme, host, and effective port. Existing applications can retain normal JDK redirects withfluxzero.web.defaultRedirectPolicy = ALLOW;NEVERdisables redirects explicitly.>= 2026.09.09fluxzero.websocket.reconnectBackoff.enabled = trueWebSocket reconnects use equal jitter over a capped exponential delay instead of retrying every second. Existing applications can retain the fixed interval with fluxzero.websocket.reconnectBackoff.enabled = false.>= 2026.09.10fluxzero.eventsourcing.maxFetchBytes = 104857600Aggregate-history pages request at most 100 MiB of serialized event payload. Existing applications can retain count-only pages with fluxzero.eventsourcing.maxFetchBytes = 0.>= 2026.09.10fluxzero.model.automaticRouting = trueCommands with one statically unambiguous Model apply and single-Model events use the canonical Model ID as routing fallback. Explicit segments and routing declarations always take precedence. Set the property to falseto retain compatibility behavior.>= 2026.10.04fluxzero.interceptApply.assertCurrent = trueValidating apply operations also check the input of each selected interceptor before transformation. Set the property to false to preserve replacement-only validation; explicit interceptor overrides win. >= 2026.10.09fluxzero.search.collectionValues = trueRanges use min/max interval overlap; ascending field sorting uses MIN, descending MAX, missing values last. Requires a compatible Runtime; incomplete indexed extrema retain legacy behavior until application reindexing. This fallback includes explicit MIN/MAX. Set false for legacy behavior. >= 2026.10.18fluxzero.model.aliasTargets = trueModel mutation ID properties select primary IDs; matching alias properties select canonical owners. Requires Runtime identity-selection version 1. Set false to retain compatibility selection. Consumer delivery filtering and fifteen-minute idle reads are enabled automatically on supporting Runtime connections, independently of this date. Override with
fluxzero.tracking.consumerFilteringorfluxzero.tracking.maxWaitDuration; unsupported peers retain broad delivery and the historic scan wait.Independent Model conflict handling defaults to
RETRYfor updates and creations regardless of this version. Override it withfluxzero.model.conflictPolicy(FLUXZERO_MODEL_CONFLICT_POLICY) or explicit builder/Model/Apply configuration. Create-only compatibility remains a separate check.Outgoing delivery defaults to STORED in SDK 2.x and normally NONE in SDK 1.x, independently of this date. Unconfigured 1.x scheduling clients and cancellation retain SENT. Override it with
DEFAULT_DELIVERY_GUARANTEE_PROPERTY. Remote request/reply separately defaults to STORED in SDK 2.x and SENT in SDK 1.x. The sameDEFAULT_DELIVERY_GUARANTEE_PROPERTYoverrides request/reply; the defaults date has no effect.Memory-aware cache pressure can be tuned with
fluxzero.cache.memoryPressure.heapThresholdPercent,fluxzero.cache.memoryPressure.gcTimeThresholdPercent, andfluxzero.cache.memoryPressure.trimRatioPercent. The amount evicted in a single pass is also capped byfluxzero.cache.memoryPressure.maxTrimWeight.- See Also:
-
-
Constructor Details
-
ApplicationProperties
public ApplicationProperties()
-
-
Method Details
-
getRequestDeliveryGuarantee
Resolves request/reply delivery from the sharedDEFAULT_DELIVERY_GUARANTEE_PROPERTY. Without an override SDK 2.x usesGuarantee.STOREDand SDK 1.x retainsGuarantee.SENT. The defaults version has no effect. Explicit NONE, SENT and STORED are all honored. Business responses remain independent of publication acknowledgments.- Parameters:
propertySource- application-local properties- Returns:
- a concrete delivery guarantee
- Throws:
IllegalArgumentException- if an explicit guarantee is invalid
-
getDefaultDeliveryGuarantee
Resolves the application delivery default using the owning component's property source. SDK 2.x usesGuarantee.STOREDwithout an override; SDK 1.x normally usesGuarantee.NONE, retaining stronger legacy operation defaults when unconfigured. This setting is independent of the defaults date. Invalid values, including unresolvedDEFAULT, fail.- Parameters:
propertySource- application-local properties- Returns:
- a concrete delivery guarantee
-
graphStrict
Resolves Graph strictness from the application's own property source. -
assertCurrent
public static boolean assertCurrent()Resolves interceptor input validation from the active application at configuration time. -
assertCurrent
Resolves interceptor input validation from the owning application's source at configuration time. -
collectionValues
Resolves the search profile once from the owning application's property source. -
modelAliasTargets
Resolves Model identity selection from the owning application's property source. -
getDefaultsVersion
Returns the active Fluxzero defaults version, ornullwhen compatibility defaults are used. -
getDefaultsVersion
Returns the Fluxzero defaults version from the given source, ornullwhen compatibility defaults are used.- Throws:
IllegalArgumentException- ifDEFAULTS_VERSION_PROPERTYis not inyyyy.MM.ddformat
-
defaultsVersionAtLeast
Returns whether the active defaults version opts into behavior introduced on or before the given date. -
defaultsVersionAtLeast
Returns whether the given source opts into behavior introduced on or before the given date. -
getProperty
-
mapProperty
-
mapProperty
public static <T> T mapProperty(String name, Function<String, T> mapper, Supplier<T> defaultValueSupplier) Maps a property value identified by its name to a desired type using the provided mapping function. If the property is not found, the method returns a default value supplied by the given supplier. -
getFirstAvailableProperty
-
getTaskId
Returns the configured platform task ID, ornullwhen the application does not run as a known task. -
getTaskId
Returns the platform task ID from the given property source, ornullwhen absent or blank. -
createClientId
Creates a unique ID for a client instance. An explicitly configuredFLUXZERO_CLIENT_IDis used when present. Otherwise, a random UUID is generated and prefixed withFLUXZERO_TASK_IDwhen available. Callers should create this ID once and retain it across reconnects. -
createClientId
Creates a unique ID for a client instance from the given property source. -
getBooleanProperty
Resolves a boolean property by key, returningfalseif not present.Accepts case-insensitive "true" as
true, otherwise returnsfalse. -
getBooleanProperty
Resolves a boolean property by key, returning a default if the property is not present. -
getIntegerProperty
Resolves an integer property by key, ornullif not found.- Throws:
NumberFormatException- if the property value is not a valid integer
-
getIntegerProperty
Resolves an integer property by key, or returns the given default value if not found.- Throws:
NumberFormatException- if the property value is not a valid integer
-
getLongProperty
Resolves a long property by key, ornullif not found.- Throws:
NumberFormatException- if the property value is not a valid long
-
getLongProperty
Resolves a long property by key, or returns the given default value if not found.- Throws:
NumberFormatException- if the property value is not a valid long
-
getProperty
-
requireProperty
Returns the string property for the given key, throwing anIllegalStateExceptionif not found. -
containsProperty
Returnstrueif a property with the given name exists. -
substituteProperties
-
substituteProperties
Substitutes placeholders in the properties using current property values.Placeholders use the syntax
${propertyName}. -
getEncryption
Returns the currently activeEncryptioninstance.By default, wraps the encryption from the current
PropertySource. -
encryptValue
Encrypts the given value using the configuredEncryptionstrategy. -
decryptValue
Decrypts the given encrypted value using the configuredEncryptionstrategy.Returns the original value if decryption is not applicable.
-