@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
| Parameter | Type | Default | Description |
|---|---|---|---|
key | String | required | The configuration key to resolve from the source. Uses dot-notation for hierarchical config (e.g., feature.checkout.enabled). |
source | String | platform://marz | Config source URI. Supported schemes: file://, classpath:, http(s)://, platform://marz. |
safetyNetInterval | long | 60000 | Safety-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. |
defaultValue | String | "" | 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. |
type | MarzType | INFERRED | Explicit type hint. Usually not needed — MARZ infers the type from the field declaration. |
description | String | "" | Human-readable description shown in the MARZ Platform dashboard. |
requiresApproval | boolean | false | Whether changes require RBAC approval in the platform. Ignored for file-based sources. |
sensitive | boolean | false | Mask values as *** in all log output, events, and heartbeat reports. |