Giter VIP home page Giter VIP logo

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

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."

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!

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.