spring-cloud-openfeign | Support for using OpenFeign in Spring Cloud apps | Microservice library

 by   spring-cloud Java Version: 4.0.4 License: Apache-2.0

kandi X-RAY | spring-cloud-openfeign Summary

kandi X-RAY | spring-cloud-openfeign Summary

spring-cloud-openfeign is a Java library typically used in Architecture, Microservice, Spring Boot, Spring applications. spring-cloud-openfeign has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.

this project provides openfeign integrations for spring boot apps through autoconfiguration and binding to the spring environment and other spring programming model idioms. declarative rest client: feign creates a dynamic implementation of an interface decorated with jax-rs or spring mvc annotations. to build the source you will need to install jdk 17. spring cloud uses maven for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing. the projects that require middleware (i.e. redis) for testing generally require that a local instance of [docker] www.docker.com/get-started) is installed and running. the spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spring-cloud-openfeign has a medium active ecosystem.
              It has 998 star(s) with 672 fork(s). There are 55 watchers for this library.
              There were 4 major release(s) in the last 12 months.
              There are 48 open issues and 544 have been closed. On average issues are closed in 162 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of spring-cloud-openfeign is 4.0.4

            kandi-Quality Quality

              spring-cloud-openfeign has 0 bugs and 0 code smells.

            kandi-Security Security

              spring-cloud-openfeign has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              spring-cloud-openfeign code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              spring-cloud-openfeign is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              spring-cloud-openfeign releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 16842 lines of code, 1564 functions and 187 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed spring-cloud-openfeign and discovered the below as its top functions. This is intended to give you an instant insight into spring-cloud-openfeign implemented functionality, and help decide if they suit your requirements.
            • Executes the given request
            • Builds the RetryTemplate
            • Execute with load balancer processing
            • Convert request to HttpRequest
            • Resolves a method invocation
            • Creates a supplier that dispatch the request
            • Unwraps the exception and rethrow the exception
            • Processes the annotations on the given parameter
            • Returns a type descriptor for the given method parameter index
            • Adds a path variable annotation to the template
            • Converts a reference to a Feign target
            • Add an argument to the request
            • Overridden to customize the query
            • Encode the given object
            • Add custom serializers
            • Creates an invocation handler
            • Gets the refresh url
            • Returns default annotated arguments
            • Add a header annotation
            • Executes the request
            • Apply cookie header
            • Add an annotation to the template
            • Process annotation on method
            • Add matrix annotation
            • Transform request to load balancer
            • Encode the body
            Get all kandi verified functions for this library.

            spring-cloud-openfeign Key Features

            No Key Features are available at this moment for spring-cloud-openfeign.

            spring-cloud-openfeign Examples and Code Snippets

            No Code Snippets are available at this moment for spring-cloud-openfeign.

            Community Discussions

            QUESTION

            Maven Fails To Find Dependency
            Asked 2021-Jun-29 at 13:28

            This is a really odd error that I am getting while doing a maven build. I am encountering an error like this:

            ...

            ANSWER

            Answered 2021-Jun-29 at 13:28

            I feel really silly about this now. It turns out someone uploaded something to our internal artifactory for commons-lang that was not really commons-lang. No idea how that happened, but it was a never-ending source of frustration for me. If anyone else ever sees something that doesn't make sense like this, compare the size of the jar in your .m2 folder with one downloaded directly from maven central. That would have saved me a lot of time.

            Source https://stackoverflow.com/questions/68068614

            QUESTION

            Ribbon load balancer client not disabling in Spring boot 2.4.3 & Cloud 2020.0.1. Using Consul for load balancing instead
            Asked 2021-Jun-06 at 15:13

            I'm currently working on a microservices application for my internship using Consul for service discovery and feign clients for communicating between the services. When we started working on the existing project which already was built using microservices, we upgraded Spring boot to 2.4.3 & cloud to 2020.0.1, so that we could make use of Java 15 to use records instead of normal classes for dtos. The problem we have now is that, whenever we make a call to a composite service, that will try to retrieve data from multiple services (for example users and teams service), that we get the following stacktrace:

            ...

            ANSWER

            Answered 2021-Jun-04 at 07:23

            Can you try excluding ribbon dependency as shown below

            Source https://stackoverflow.com/questions/67717907

            QUESTION

            Using Feign builder requests doesn't send trace-id, span-id to child clients but using rest template is showing all headers on child clients
            Asked 2021-May-28 at 06:05

            I'm making a sequential request using Feign Builder. There are no x-b3-traceid,x-b3-spanid .. in the title of the request. That's why the log my last client appears on the zipkin.

            I use spring boot 2.4.2 , spring cloud 2020.0.0 , feign-core 10.10.1 , feign-okhttp 10.10.1. I have tried spring-cloud-openfeign and i achieved wanted result. But i don't want to use this lib. There are requests when using Feign Builder and Rest Template in here. I dont' see same log at zipkin.

            My Client1 App. I am sending request http://localhost:8082/

            ...

            ANSWER

            Answered 2021-Mar-01 at 08:16

            The problem might be related to the fact that you're creating the Feign builder manually via Feign.builder() factory method. We're unable to instrument that call. You should create a bean (via SleuthFeignBuilder.builder) and inject that into your code.

            Source https://stackoverflow.com/questions/66167917

            QUESTION

            Feign & Pageable
            Asked 2021-Apr-07 at 15:20

            Tell me how to properly configure the work of Feign and Spring Pageable Here are my Feign settings

            ...

            ANSWER

            Answered 2021-Apr-07 at 15:20

            Updated spring-cloud-version to version 3.0.2 helped

            Source https://stackoverflow.com/questions/66973359

            QUESTION

            Surefire on multi-module spring-boot project
            Asked 2021-Mar-24 at 09:21

            so I have a simple project like:

            ...

            ANSWER

            Answered 2021-Mar-24 at 09:20

            As of Spring Boot 2.4, JUnit 5’s vintage engine has been removed from spring-boot-starter-test. If we still want to write tests using JUnit 4, we need to add the following Maven dependency:

            Source https://stackoverflow.com/questions/66766678

            QUESTION

            How to add dynamic header values to feign-client through Feign interceptor from current request?
            Asked 2020-Dec-09 at 07:12

            I am new to Spring-cloud-openfeign. I am trying to build a micro-service based system. To make things look simpler, just take 3 of those services, which are Gateway, Service-A, Service-B. When I make a request from my frontend to Service-A through Gateway, the gateway will verify the JWT token in the request, and extract user information (userId) from the token and will put in the request as a header and will forward it to Service-A. Now Service-A will call service-B through feign-client. Now during this inter-service call through feign-client, I am trying to forward userId from the current request in Serice-A to outgoing request to service-B through a Feign RequestIterceptor. But I am not able to retrieve current request in the interceptor. I tried the solution in this stack_over_question, but it doesn't seem to work. I think I face the same problem as of this github_issue. I could see some blogs and articles advising to use RequestContextListner or RequestContextFilter to get the current request out of the Dispatcher-Servlet, But I couldn't find out how to use or implement it. Following is the code I am currently using

            ...

            ANSWER

            Answered 2020-Dec-09 at 07:12

            I had similar use case where I need to get header in the interceptor. The code is similar to below.

            Source https://stackoverflow.com/questions/65124153

            QUESTION

            dependecy not found: openfeign
            Asked 2020-Dec-06 at 12:40

            I get the error: Could not find artifact org.springframework.cloud:spring-cloud-openfeign:pom:unknown in central (https://repo.maven.apache.org/maven2)

            Here is my pom.xml

            ...

            ANSWER

            Answered 2020-Dec-06 at 12:40

            org.springframework.cloud has 2 packages:

            • spring-cloud-starter-openfeign
            • spring-cloud-openfeign-core

            but not spring-cloud-openfeign

            Source https://stackoverflow.com/questions/65167089

            QUESTION

            how to pass Spring Pageable to FeignClient
            Asked 2020-Aug-02 at 12:46

            as I wrote in this issue: https://github.com/spring-cloud/spring-cloud-openfeign/issues/375 and in this SO question: Spring data Pageable does not work with feign client

            I have some problems sending a Pageable object in a POST request containing a @requestbody element.

            First I tried sending the Pageable embedded in my RequestBody since it was generated as example when using springdoc-openapi-webmvc-core.

            Example:

            ...

            ANSWER

            Answered 2020-Aug-02 at 12:46

            Your question is more related to feign usage than springdoc-openapi. Using using org.springframework.cloud.openfeign.SpringQueryMap, solves your problem.

            Source https://stackoverflow.com/questions/63152147

            QUESTION

            How to pass Pageable to Feign Client in POST Request with additional @RequestBody
            Asked 2020-Jul-29 at 12:51

            I tried to create a feign client for my REST service controller in Spring.

            ...

            ANSWER

            Answered 2020-Jul-27 at 13:14

            The exception is related "too many Body parameters", that means you have to send only one object in RequestBody, in this particular case I believe it is MeasureDto "example". The page you have to pass in a different way, generally I have a "page" integer attribute in the class (in your case, MeasureDTO) or I send the page number as @RequestParam, like it:

            Source https://stackoverflow.com/questions/63115610

            QUESTION

            How do I use Apache Tailer within a Spring Boot App?
            Asked 2020-May-30 at 16:23
            Main Question

            I'm writing an app (available here on GitHub - build/run instructions below) that scrapes a log file and reacts to certain events written to the log (in this case, making an HTTP request to a REST API). I've chosen Java, Spring Boot 2.x, Apache Tailer and OpenFeign as the primary vehicles to that end.

            I suspect I'm not understanding how Apache Tailer and the threading it does in the background work, or how to properly leverage it within a Spring Boot app. What's a correct way to initialize and run a Tailer in the context of a Spring Boot app?

            Additional Info

            To test this, I'm starting the app locally, and echoing lines of text into the given log file via a shell. As of writing (commit 1fed906), when I run the app it seems that:

            1. The Tailer initializes (I can see TailerListenerAdapter.init() is called on the TailerListenerAdapter I constructed it with)

            2. The Tailer runs (I see everything I write to the log file it watches passed to TailerListenerAdapter.handle()).

            As soon as I write something to the log that my TailerListenerAdapter knows it should react to, it looks like control exits from the Tailer.run() method call, and the app exits (gracefully). I want it to keep running and tailing the log until I stop the app though.

            I wasn't really sure where to call Tailer.run() in this context so I have it in a @PostConstruct method in my custom Tailer subclass. I've never used @PostConstruct before, so I'm not 100% sure I'm using it correctly, or if there's a better place to put it to ensure that run() gets called at start up while also allowing me to inject all of my my config-file / bean driven options into it.

            Build / Run Instructions
            1. Clone the project
            2. Run this in a shell: mvn spring-boot:run -Dspring-boot.run.arguments=--tailer.logFile=/path/to/any/test.log,--logging.level.com.github.ubunfu.mclogbot=DEBUG

              OR

              Set up an equivalent run configuration in your IDE. There's an application-local.yml Spring Boot config file with a place to specify the path to the test log file. In IntelliJ, set up a Maven run config with the following in Command Line: spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=local

            ...

            ANSWER

            Answered 2020-May-30 at 16:23

            I'm pretty sure now that the right way to run the Tailer in a Spring Boot app is to modify the main class to implement CommandLineRunner (as described in this nice little Mkyong article), and run the Tailer from there. I believe this is because Spring boot assumes that you're writing a web app where the entry-point is an inbound request to be handled by Tomcat or something. If you want to change the entry-point (e.g. it's not a web app), you'd do the above and essentially override the default behavior.

            I'm still don't fully understand the strange behavior where the first time I write a log message the application should react to (rather than just ignore) the Tailer and the app seemed to stop gracefully. However, I believe I've fixed it so I'll share.

            In this app, the behavior for "reacting" to a specific log message I keep referring to is:

            1. Parsing the log message
            2. Building a HTTP request
            3. Using a Feign client to send it to a REST API

            Previously, I had been ignoring the response from the Feign client - not even assigning it to a Response object. When I decided to try that to see what was actually coming back from the API, the behavior of the app changed such that it no longer exited by itself after the first invocation. I could keep writing messages and it would keep hitting the API.

            Here is a link to the PR with the change that I'm pretty sure fixed it.

            I hope this helps somebody else!

            Source https://stackoverflow.com/questions/62005058

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spring-cloud-openfeign

            You can download it from GitHub, Maven.
            You can use spring-cloud-openfeign like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-cloud-openfeign component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/spring-cloud/spring-cloud-openfeign.git

          • CLI

            gh repo clone spring-cloud/spring-cloud-openfeign

          • sshUrl

            git@github.com:spring-cloud/spring-cloud-openfeign.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link