A simple solution to demonstrate how to use microservices architecture to solve business problems. This design allows the system to be easily extended to add more features and independently scallable
There is a major new technology that is destined to be a disruptive force in the field of transportation: the drone. Just as the mobile phone allowed developing countries to leapfrog older technologies for personal communication, the drone has the potential to leapfrog traditional transportation infrastructure.
The service should allow:
- registering a drone;
- loading a drone with medication items;
- checking loaded medication items for a given drone;
- checking available drones for loading;
- check drone battery level for a given drone;
The solution uses microservices architecture with 3 services, namely
- DroneMicroservice : This service is incharge of the drone activities like registering and loading drones
- DroneMonitorservice: This service runs a periodic task to check drone health and generate logs.
- DroneDiscoveryservice : This is used for service discovery for inter-microservices communication
To run the applicatiion, follow this order:
- Start the discovery service : type ./mvnw spring-boot:run (in the project directory)
- Start the drone-microservice
- Start the drone-monitorservice
To access the api: Please check out the swagger page for the api documentation: http://localhost:8182/swagger-ui.html.
To access the Logs generated by the drone-monitorservice http://localhost:8081/api/v1/audits
To run Unit tests.
- Start the discovery service (This is necessary because the unit test loads the application instance and the microservices will try to connect to eureka server).
- run $ mvn test -Dtest="DroneServiceImplTest"