Quickstart
Get runtime configuration hot-swap working in your Spring Boot application in under 60 seconds.
Prerequisites
- Java 17+
- Spring Boot 3.x
- Maven or Gradle
Step 1: Add the dependency
<dependency>
<groupId>com.mymarz</groupId>
<artifactId>marz-spring-boot-starter</artifactId>
<version>0.1.0</version>
</dependency>
Step 2: Annotate a field
@Service
public class FeatureService {
@Marz(key = "feature.new-dashboard",
source = "file://config/features.yml")
private volatile boolean newDashboardEnabled = false;
public boolean isNewDashboardEnabled() {
return newDashboardEnabled;
}
}
Step 3: Create your config file
# config/features.yml
feature:
new-dashboard: true
Step 4: Edit and watch
Change the value in features.yml. The field updates in ~50ms. No restart needed.
Supported types
MARZ supports boolean, int, long, double, and String fields.
Configuration properties
| Property | Default | Description |
|---|---|---|
marz.enabled | true | Enable/disable MARZ globally |
marz.default-poll-interval-ms | 5000 | Default WatchService poll interval |
marz.config-dir | ./config | Default config directory |
Next steps
- Read the Annotation API reference for all 8 parameters
- See Migration from @RefreshScope if you’re switching