How jjtoribio/test-microservices works
• Config Server (config-server): Runs on port 8888 and centralizes application configuration. This service supplies config properties upon startup to all other microservices.
• Eureka Server (eureka-server): Located on port 8761, it is responsible for service registration and discovery. All microservices register themselves here.
• Daas-Phones Microservice (daas-phones): Running on port 8082, it handles operations for phone records – including endpoints to create a new phone, retrieve a phone by its ID, and list all available phones (with pagination). It connects to a MongoDB instance, and its API is documented via Swagger (OpenApi v3).
• Daas-Orders Microservice (daas-orders): Running on port 8083, this service manages direct order operations: creating orders, fetching an order by id, and listing orders with pagination. It also persists data to MongoDB, and uses a Swagger UI for API clarity.
• Bs-Orders Microservice (bs-orders): Located on port 8081, it acts as an orchestrator. Rather than persisting or processing data directly, it validates incoming order requests (customer info and phone IDs) by consulting the phone service for catalog data and then delegating order creation to the orders service. It, too, exposes Swagger endpoints for its single exposed operation.
• MongoDB: Although not a microservice per se, a MongoDB instance is managed via docker-compose (with an initialization script in mongo-entrypoint) and is the backing database for the daas-phones and daas-orders services.
• For inter-service communication:
• That Docker containers encapsulate each microservice and that the deployment is orchestrated via Docker Compose.
Important Architectural Patterns or Principles
• Microservices: Each service is a self-contained Spring Boot application with its own set of responsibilities.
• Service Discovery: Leveraging Eureka for dynamic service registration.
• Centralized Configuration: Managing configuration via a dedicated config server.
• API Documentation: Each service exposes its REST endpoints documented by an OpenAPI/Swagger UI.
• Dockerization: Each module contains its own Dockerfile and the overall system uses docker-compose for service management (especially for MongoDB).
• Use of Maven: There is a parent POM that builds all modules in one command and individual POM files per module.
• MongoDB below or at the bottom, with lines connecting it to both daas-phones and daas-orders.
• Annotations about Swagger access for API testing (e.g., “Swagger UI available at http://localhost:8082/webjars/swagger-ui/index.html for daas-phones”).