Skip to content
This repository was archived by the owner on Apr 12, 2023. It is now read-only.

Latest commit

 

History

History
21 lines (15 loc) · 926 Bytes

File metadata and controls

21 lines (15 loc) · 926 Bytes

unit-springboot-sample

Sample application using the unit library and spring boot together.

Demonstrates an application with several units:

  • HelloController is a spring RestController, as well as a Unit
  • SampleHttpApiResource is a Unit wrapper around an HTTP API client.
  • MutableConfig is a mutable configuration store, holding some runtime-mutable config for SampleHttpApiResource
  • HealthCheckController provides an endpoint to display the system state in DOT graph format.

Import the project into Intellij (or IDE of your choice supporting Spring Boot) and run the Application class.

The application will run an http server on port 8080. Access /healthcheck to see the graph of all units & their state. Post to /setconfig to change the configuration value, which updates the configuration & causes dependents to restart.