@Marz Annotation Reference

The @Marz annotation is the entire public API. Place it on a field to enable runtime configuration hot-swap.

Usage

@Marz(key = "feature.checkout.enabled",
      source = "file://config/features.yml",
      safetyNetInterval = 30000,
      defaultValue = "false")
private volatile boolean checkoutEnabled = false;

Parameters

ParameterTypeDefaultDescription
keyStringrequiredThe configuration key to resolve from the source. Uses dot-notation for hierarchical config (e.g., feature.checkout.enabled).
sourceStringplatform://marzConfig source URI. Supported schemes: file://, classpath:, http(s)://, platform://marz.
safetyNetIntervallong60000Safety-net CRC32 check interval in ms. WatchService is the primary event-driven mechanism; this periodic checksum runs as insurance for edge cases (NFS, macOS kqueue delays). Minimum: 500ms. Set to -1 for push-only mode.
defaultValueString""Fallback applied when the key is missing at startup or the source is unreachable. Also governs runtime removal: if a key is later removed from the source, the field reverts to defaultValue when one is declared, otherwise it retains its current value (a removed key never writes null to a primitive). Coerced to the target field type.
typeMarzTypeINFERREDExplicit type hint. Usually not needed — MARZ infers the type from the field declaration.
descriptionString""Human-readable description shown in the MARZ Platform dashboard.
requiresApprovalbooleanfalseWhether changes require RBAC approval in the platform. Ignored for file-based sources.
sensitivebooleanfalseMask values as *** in all log output, events, and heartbeat reports.