Giter VIP home page Giter VIP logo

springboot-3-micro-service-demo's Introduction

Microservices Demo Project

alt text

This repository contains a demo project showcasing a microservices-based application, designed to provide a hands-on understanding of microservices architecture and implementation. The project consists of an API Gateway, Config Server, Discovery Server, and two microservices: Student and School.

Table of Contents

Getting Started

Follow the instructions below to set up the project on your local machine for development and testing purposes.

Prerequisites

Ensure you have the following software installed on your system before proceeding:

  • Java Development Kit (JDK) 17 or later
  • Maven
  • Docker (optional, for containerization)

Installation

  1. Clone the repository:

git clone git remote add origin [email protected]:ali-bouali/springboot-3-micro-service-demo.git

  1. Navigate to the project directory:
  2. Build and package each component with Maven:

Project Components

API Gateway

The API Gateway serves as the single entry point for all client requests, managing and routing them to the appropriate microservices.

Config Server

The Config Server centralizes configuration management for all microservices, simplifying application maintenance and consistency across environments.

Discovery Server

The Discovery Server provides service registration and discovery, enabling seamless service-to-service communication within the microservices ecosystem.

Student Microservice

The Student Microservice is responsible for managing student-related data and operations, such as adding, updating, and retrieving student records.

School Microservice

The School Microservice manages school-related data and operations, including adding, updating, and retrieving school records.

Inter-Service Communication

Using OpenFeign

This project demonstrates inter-service communication using OpenFeign, a declarative REST client that simplifies service-to-service communication within the microservices ecosystem.

Distributed Tracing

Using Zipkin

The project showcases the use of Zipkin for distributed tracing, enhancing application observability and enabling the visualization and troubleshooting of latency issues.

Contributing

Contributions are welcome! Please read our CONTRIBUTING.md for details on how to contribute to this project.

License

This project is licensed under the MIT License.

Contact

[Ali Bouali] - [[email protected]]

[Website] - [https://aliboucoding.com/courses]

Project Link: https://github.com/ali-bouali/springboot-3-micro-service-demo

Acknowledgements

springboot-3-micro-service-demo's People

Contributors

ali-bouali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

springboot-3-micro-service-demo's Issues

Feign Client Configuration Issue: Unable to Dynamically Use Service Name as Host in Eureka Setup

package com.alibou.school.client;

import com.alibou.school.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "student-service", url = "${application.config.students-url}")
public interface StudentClient {

    @GetMapping("/school/{school-id}")
    List<Student> findAllStudentsBySchool(@PathVariable("school-id") Integer schoolId);
}

Issue Description:

I've encountered an issue with my Feign client setup when working with a service registered in Eureka. The current configuration uses the url attribute to specify the endpoint, which feels like hardcoding and lacks the elegance of using the service name as the host.

Desired Outcome:

I want to configure the Feign client to dynamically use the service name registered in Eureka without specifying the URL directly. However, when attempting to remove the url attribute, the framework defaults to accessing the resource on port 80, despite setting server.port=8090 in the configuration file of the student service.

Questions:

  1. Is there a more elegant way to configure the Feign client to use the service name as the host without hardcoding the URL?
  2. How can I ensure that the Feign client uses the correct port specified in the configuration file of the student service rather than defaulting to port 80?

Any assistance or guidance on resolving this issue would be greatly appreciated. Thank you!

can you please add a license?

want to express my gratitude for the work you've done with the code. It has been incredibly helpful in bringing my project to life. However, I noticed that you didn't include a license with it. I would like to ensure that I can submit my code as a university project without any legal issues.

Therefore, I kindly request that you add a license to your work. Thank you for understanding! Without your license, I will not be able to submit my code."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.