@@ -4,17 +4,17 @@ This example demonstrates runtime endpoint gate management via the Spring Boot A
44
55## Features
66
7- - ` GET /actuator/endpoint-gates ` -- list all endpoint gates
8- - ` GET /actuator/endpoint-gates/{gateId} ` -- get a single endpoint gate
9- - ` POST /actuator/endpoint-gates ` -- update a endpoint gate (enabled state and optional rollout )
10- - ` DELETE /actuator/endpoint-gates/{gateId} ` -- remove a endpoint gate
11- - ` EndpointGateChangedEvent ` / ` EndpointGateRemovedEvent ` -- ` @EventListener ` handling
7+ - ` GET /actuator/endpoint-gates ` — list all endpoint gates
8+ - ` GET /actuator/endpoint-gates/{gateId} ` — get a single endpoint gate
9+ - ` POST /actuator/endpoint-gates ` — update an endpoint gate (enabled state, rollout, and schedule )
10+ - ` DELETE /actuator/endpoint-gates/{gateId} ` — remove an endpoint gate
11+ - ` EndpointGateChangedEvent ` / ` EndpointGateRemovedEvent ` — ` @EventListener ` handling
1212
1313## Configuration
1414
1515``` yaml
16- endpoint-gates :
17- features :
16+ endpoint-gate :
17+ gates :
1818 demo-feature :
1919 enabled : true
2020 rollout : 80
@@ -34,18 +34,43 @@ The `actuator` module automatically registers `MutableInMemoryEndpointGateProvid
3434` MutableInMemoryRolloutPercentageProvider` , which replace the default read-only providers
3535from the `webflux` module via `@ConditionalOnMissingBean`.
3636
37+ Internally, `ReactiveEndpointGateEndpoint` is used instead of `EndpointGateEndpoint`.
38+ The request/response format is identical to the WebMVC version.
39+
3740The `EndpointGateEndpoint` is exposed at `/actuator/endpoint-gates` and allows full CRUD
3841operations on endpoint gates at runtime without restarting the application.
3942
4043Events are published on every write or delete :
4144- `EndpointGateChangedEvent` : ` gateId()` , `enabled()`, `rolloutPercentage()` (null if not changed)
42- - `EndpointGateRemovedEvent` : ` gateId()` (only fired when the flag actually existed)
45+ - `EndpointGateRemovedEvent` : ` gateId()` (only fired when the gate actually existed)
4346
4447# # Demo steps
4548
46491. Start the application
47- 2. List all flags : ` GET /actuator/endpoint-gates`
48- 3. Get a single flag : ` GET /actuator/endpoint-gates/demo-feature`
50+ 2. List all gates : ` GET /actuator/endpoint-gates`
51+ 3. Get a single gate : ` GET /actuator/endpoint-gates/demo-feature`
49524. Enable another-feature : ` POST /actuator/endpoint-gates` with body `{"gateId":"another-feature","enabled":true}`
50535. Delete another-feature : ` DELETE /actuator/endpoint-gates/another-feature`
51- 6. Check the console log for published events
54+ 6. Set a schedule on demo-feature :
55+ ` ` ` bash
56+ curl -X POST http://localhost:8080/actuator/endpoint-gates \
57+ -H "Content-Type: application/json" \
58+ -d '{
59+ "gateId": "demo-feature",
60+ "enabled": true,
61+ "scheduleStart": "2026-03-10T09:00:00",
62+ "scheduleEnd": "2026-03-10T18:00:00",
63+ "scheduleTimezone": "Asia/Tokyo"
64+ }'
65+ ` ` `
66+ 7. Remove the schedule from demo-feature :
67+ ` ` ` bash
68+ curl -X POST http://localhost:8080/actuator/endpoint-gates \
69+ -H "Content-Type: application/json" \
70+ -d '{
71+ "gateId": "demo-feature",
72+ "enabled": true,
73+ "removeSchedule": true
74+ }'
75+ ` ` `
76+ 8. Check the console log for published events
0 commit comments