I have 2 classes: filter and class to get response body. As far as I know I need to specify order NettyWriteResponseFilter.WRITE_RESPONSE_FILTER_ORDER-1 so filter will get response body. But when I implement Ordered or use annotation @Order or via OrderedGatewayFilter I cann’t call BodyRewrite class(which gets response body). When I try to use this for global filter(implemented GlobalFilter) it works
Tag: spring-cloud
How to mock the discoveryClient?
I’m working with Eureka and I have a Method that uses the DiscoveryClient to obtain the instances of a service and the call this service and retrieve some information like this: It works, but now I want to make a JUnit test for the method and as I’m not going to have the Eureka working in the JUnit test environment,
Route order in Spring Cloud Gateway
We are implementing routes programmatically using a implementation of RouteDefinitionLocator. We have two services which should register at the same route path, where one of them is meant as a fallback if the other one does not exist. The preferred route with the specific path is: And the more general one, which should only fire if other route was found:
Spring Cloud Gateway for composite API calls?
I am starting to build a Microservice API Gateway, and I am considering Spring Cloud to help me with the routing. But some calls to the Gateway API will need multiple requests to different services. Lets say I have 2 services: Order Details Service and Delivery Service. I want to have a Gateway endpoint GET /orders/{orderId} that makes a call
Could not transfer artifacts from/to central maven repo when using Spring Framework Cloud
I am trying to create a maven project using Spring Framework Cloud. I defined pom.xml file as below When trying to build maven getting error for all dependencies as Could not transfer artifacts from/to central (https://repo.maven.apache.org/maven2) Multiple annotations found at this line: – Failure to transfer org.springframework:spring-orm:jar:4.2.6.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted
Authentication issue with repo accessed from Spring Cloud Config Server hosted on GitHub
I’m hosting a configuration in a repo on GitHub. If I keep the repo public all’s good, but if I make it private I face: the property I use to target the repo is What should I do to configure this properly with the private repo, thanks Answer you need to add the and things should workout for you
Spring cloud : Can not get Feign client to work with consul
I am trying to set up a simple spring cloud consul app. I have a “distribution” service up and registered in consul (with the spring.application.name property set to “distribution”) I have an “acquisition” service that is trying to make a call to the “distribution” service using feign. Here is my main class here is my feign client and here is
Error Injecting FeignClient from another Project
I am having trouble auto wiring a feign client from another project. It appears that the implementation of the feign client is not being generated and injected. This is the error I am getting. The feign client is pretty straight forward. I have removed the imports for brevity. I added the component scan to my project to include the application