Skip to content

A set of microservices built with Spring Boot, featuring service discovery with Eureka, load balancing with Ribbon, and an API gateway with Zuul.

Notifications You must be signed in to change notification settings

nihadamirov/spring-boot-microservices

Repository files navigation

Spring Boot Microservices Project

Overview

This project is a collection of microservices built using Spring Boot. It demonstrates various aspects of microservices architecture, including service discovery, load balancing, and API gateway integration.

Project Structure

  • Eureka Server: Provides service discovery and registration.
  • API Gateway (Zuul): Manages routing and load balancing for incoming requests to various microservices.
  • Order Service: Manages order-related operations.
  • Product Service: Handles product-related operations.
  • Customer Service: Manages customer-related operations.
  • MongoDB: Database used by services to store data.
  • Mongo Express: Provides a web interface to interact with MongoDB.

Technologies Used

  • Spring Boot: Framework for building microservices.
  • Eureka: Service discovery and registration.
  • Zuul: API Gateway for routing and load balancing.
  • Ribbon: Client-side load balancing.
  • MongoDB: NoSQL database.
  • Docker: Containerization of services.

Setup and Running

  1. Clone the Repository

    git clone https://github.com/nihadamirov/spring-boot-microservices.git
    cd spring-boot-microservices
  2. Build and Run the Services

    Ensure Docker is installed and running. Then build and start the services using Docker Compose:

    docker-compose up --build
  3. Access the Services

Configuration

  • Eureka Server: Configured to listen on port 8761.
  • API Gateway: Configured to route requests to order-service, product-service, and customer-service.
  • Ribbon: Used within the API Gateway for client-side load balancing.

Testing

You can test the services by sending HTTP requests to the API Gateway. For example:

  • List All Orders: GET https://localhost:8088/orders
  • Get a Product by ID: GET https://localhost:8088/products/{id}
  • Get All Products: GET https://localhost:8088/products
  • Create a Customer: POST https://localhost:8088/customers with a JSON body

Contribution

Feel free to fork the repository and submit pull requests. Contributions are welcome!

About

A set of microservices built with Spring Boot, featuring service discovery with Eureka, load balancing with Ribbon, and an API gateway with Zuul.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published