Demonstration of building a service in Java from scratch.
The demo builds a simple phone normalization service that uses non-blocking I/O and asynchronous request handling. It does the following:
- Creates a single executable that is containerization ready
- Uses asynchronous request handling for high request concurrency
- Takes advantage of Ribbon with netty-io for non-blocking external dependency I/O
- Takes advantage of Hystrix for dependency monitoring, circuit-breaking, and fall-backs.
- Provides monitoring end-points using Spring Boot Actuator
Run the project locally:
- Build with maven:
mvn clean install
- Navigate to the
/web
directory - Run with the application:
mvn spring-boot:run
Once the demo is running, you can access the following:
- Basic phone normalization request: http://localhost:8080/api/phones/801-234-5678
- Basic normalized user request: http://localhost:8080/api/users/3
- API documentation: http://localhost:8080/swagger-ui.html
- Hystrix dashboard
- Performance monitoring endpoint: http://localhost:8080/metrics
The demo stops short of adding framework logging or building a WAR file. A sample project with these features can be found in Stash.
A Java Development Guide can be found in Confluence.