This project demonstrates how you can build two parties (micro-services) sharing a common data model without sharing code, and therefore only build a loose coupling and avoiding a code dependency between them.
Each side defines an own model (here of a customer) which is transferred using JSON. To illustrate point the customer model has on the client side an additional attribute (birth date), which does not exist in the data model on the server side.
Being independent in regards to common code is considered a great benefit when it comes to deploying each module resp. building distinct continuous deploy pipelines, without requiring the other project to be rolled out at the same time.
For further discussion, read for example an interview with Sam Newman about Sharing Code
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To build and run the sample projects you require only a JDK of version 8.
To run the automated tests for the client and server demo projects please follow the instructions below.
For building and testing you can use the following maven commands:
cd client
./mvnw clean package
Same goes for the server side, from the root project directory execute:
cd server
./mvnw clean package
The integration tests require a running instance of the server. To start-up the Spring Boot based web application execute:
cd server
./mvnw spring-boot:run
By default this will start an Spring Boot web application on port 8081. In a separate terminal start the client side integration tests with:
cd client
./mvnw test -Dtest-group=cdc-tests
- Spring Boot - The web framework used
- Spring REST Docs - Spring REST Docs for testing and creating documentation
- Lombok - Avoid boiler-plate code
- Maven - Dependency Management of libraries
- Niko Schmuck - Initial work - nikos
This project is licensed under the MIT License - see the LICENSE.md file for details