Skip to content

Latest commit

 

History

History
86 lines (64 loc) · 2.21 KB

File metadata and controls

86 lines (64 loc) · 2.21 KB

Spring Boot 2.0 Demo

This is my little playground application. It demonstrates the following features.

  1. What do we have out of the box?
    1. very quick project start-up (via start.spring.io)
    2. ready to use parent POMs
    3. Maven plug-in produces runnable fat JAR
    4. embedded servlet engine
    5. serving static content
      1. supporting webjars for Bootstrap, jQuery & Co
  2. REST
  3. Configuration
    1. ready to use configuration chain (see Setting Properties below)
    2. type save config
  4. Metrics & Monitoring via Actuator
    1. including an own health indicator
    2. including an own metric (counter)
    3. app info (Git commit id)
  5. JPA, using
    1. an opinionated in-memory DB H2 setup
    2. auto generated repositories
    3. transactions
  6. Testing
  7. Caching
  8. Task scheduling
  9. Application events
    1. Async feature
  10. JMS messaging

Some Notes

This demo uses Project Lombok data classes to reduce boiler plate code.

Build and Run

$ mvn package
$ java -jar target/springdemo-0.0.1-SNAPSHOT.jar
$ open 'http://localhost:8080'

Setting Properties

A Spring Boot application comes with a ready to use configuration chain. So you may set properties via Java system properties.

$ java -Dserver.port=8081 -Dspring.cache.type=none -jar target/springdemo-0.0.1-SNAPSHOT.jar 

... or via OS Environment.

$ export SERVER_PORT=8081
$ export SPRING_CACHE_TYPE=none
$ java -jar target/springdemo-0.0.1-SNAPSHOT.jar 

... or via application properties

$ java -jar target/springdemo-0.0.1-SNAPSHOT.jar --server.port=8081 --spring.cache.type=none 

... and of course via config file...

Documentation Links

Spring vs EJB

Some Slides