Skip to content

Hot-reloaded config replaces PATCH /config

  • Deciders: David Bauer, Julian Bäume
  • Date: 2026-06-12

Status

Accepted

Context

The Java service exposes PATCH /booking/api/config (HTTP Basic auth) to mutate a handful of runtime settings - most notably the auto-deletion interval/delay - without a redeploy. This is the only endpoint in the original API that requires HTTP Basic credentials, and it exists purely because Spring's YAML property overlay has no built-in hot-reload story.

@open-xchange/fastify-sdk provides exactly that hot-reload story natively: a Joi-validated config registry that watches a YAML file ($CONFIG_PATH/config.yaml, typically a Kubernetes ConfigMap mount) via chokidar and re-applies it without a restart (see ADR-0003).

Decision

Replace PATCH /config with the SDK's hot-reloaded config.yaml. src/config.ts defines a flat schema keeping the Java key names (pollBaseURL, maxPolls, maxEvents, maxInvitees, autoDeletionIntervalMinutes, autoDeletionDelayAfterLastSlotMinutes, footer) rather than adopting new web-foundation naming - a deliberate carry-over so operators porting values from the old service's YAML don't have to translate key names, only move them out from under the com.openexchange.booking.* prefix into a flat file. Keys omitted from the file (or removed on a later edit) fall back to hardcoded defaults on every (re)apply - see applyServiceConfig(). GET /booking/api/config remains, read-only, returning the subset the frontends need. There is no PATCH endpoint and no HTTP Basic auth path in Booking at all.

The auto-deletion job (src/services/cleanup.ts) is rescheduled from the config-reload callback in src/index.ts, so an edited autoDeletionIntervalMinutes takes effect on the running process without a restart, matching (and improving on - no HTTP call needed) the original PATCH endpoint's purpose.

Consequences

Positive

  • One fewer authentication mechanism in the service (no HTTP Basic credentials to provision, rotate, or leak).
  • Config changes are GitOps-friendly: edit the ConfigMap/values file, no API call, no credential.
  • Retains the original operational capability (change auto-deletion behavior without a redeploy) with less code, by reusing SDK infrastructure instead of building a PATCH handler and its own validation path.
  • Keeping Java key names means anyone with the old service's config values can drop them into the new flat file with no lookup table.

Negative

  • Anyone that depended on PATCH /config externally (rather than through deployment tooling) loses that capability outright - mitigated by the fact this was an internal/ops-only endpoint, not part of the owner/voter-facing API surface (see ADR-0005).
  • Config changes now require filesystem/ConfigMap access rather than an authenticated HTTP call - a different operational model that deployment tooling (Helm chart, see Operations → Deployment) has to account for explicitly (ConfigMap + checksum annotation to force a rollout when needed, or rely on the watch).

References

  • src/config.ts, src/index.ts (config reload callback), src/services/cleanup.ts (rescheduling)
  • helm/booking/templates/configmap.yaml
  • ADR-0003