Real World Example

Flash Sale Switches Without a Deploy

E-commerce teams (Flipkart, Myntra, Nykaa) change limits and flags many times during a big sale: turn Cash on Delivery off when fraud spikes, lower max items per order, change banners at midnight. With Config Server + Bus, ShopEase does it by editing Git:

23:58  ops opens PR: order-service-prod.yml  cod-enabled: false, max-items-per-order: 3
 23:59  PR approved and merged (audit trail in Git)
 00:00  webhook -> Config Server /monitor -> Bus -> all 6 order-service instances refresh
 00:00  new orders: COD hidden, max 3 items. No restart, no downtime.
 02:00  git revert -> refresh -> back to normal

The Code Behind It

@ConfigurationProperties(prefix = "shopease.orders")
public record OrderProperties(int maxItemsPerOrder, boolean codEnabled) {}

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/orders")
class CheckoutOptionsController {

    private final OrderProperties props;   // rebound on every refresh

    @GetMapping("/checkout-options")
    Map<String, Object> options() {
        return Map.of(
                "maxItemsPerOrder", props.maxItemsPerOrder(),
                "paymentModes", props.codEnabled() ? List.of("UPI", "CARD", "COD") : List.of("UPI", "CARD"));
    }
}

Example

curl localhost:8080/api/orders/checkout-options     # before
curl -X POST localhost:8888/actuator/busrefresh        # after the Git change
curl localhost:8080/api/orders/checkout-options     # after

Example output

{"maxItemsPerOrder":5,"paymentModes":["UPI","CARD","COD"]}

HTTP/1.1 204 No Content

{"maxItemsPerOrder":3,"paymentModes":["UPI","CARD"]}

Tip: Treat the config repo like code: pull requests, reviews, and separate branches or folders per environment. A typo in prod config can break checkout as badly as a code bug.