Files

32 lines
1.2 KiB
Plaintext

# order-service reads shop.order.* from the config server. OrderProperties is a Java record.
--- before
$ curl localhost:8082/orders/config
{"currency":"EUR","maxQuantity":10}
--- an unsigned request to /monitor (the curl most tutorials show)
$ curl -X POST localhost:8888/monitor -d path=order-service
HTTP 403
--- edit order-service.yml in the config repository: currency EUR -> USD, max-quantity 10 -> 3
(no request sent: with a local file: repository the monitor module watches the directory itself)
--- config server log
INFO o.s.c.c.m.FileMonitorConfiguration : Monitoring for local config changes: [run/config]
INFO o.s.c.c.monitor.PropertyPathEndpoint : Refresh for: order-service
--- order-service log
INFO o.s.cloud.endpoint.RefreshEndpoint : Refreshed keys : [shop.order.currency, shop.order.max-quantity]
--- what order-service uses after the refresh
$ curl localhost:8082/orders/config
{"currency":"EUR","maxQuantity":10}
--- a signed GitHub-style push webhook, the way a remote Git repository would call
$ curl -X POST localhost:8888/monitor -H 'X-GitHub-Event: push' -H 'X-Hub-Signature-256: sha256=<hmac>' -d '{"commits":[{"modified":["order-service.yml"]}]}'
["order-service","order"]
HTTP 200
--- same webhook, wrong signature
HTTP 403