spring-cloud-netflix

How to send POST request by Spring cloud Feign

六眼飞鱼酱① 提交于 2019-11-29 09:28:35
问题 It's my Feign interface @FeignClient( name="mpi", url="${mpi.url}", configuration = FeignSimpleEncoderConfig.class ) public interface MpiClient { @RequestMapping(method = RequestMethod.POST) public ResponseEntity<String> getPAReq(@QueryMap Map<String, String> queryMap ); } and my custom configuration public class FeignSimpleEncoderConfig { public static final int FIVE_SECONDS = 5000; @Bean public Logger.Level feignLogger() { return Logger.Level.FULL; } @Bean public Request.Options options() {

How to forward to different path using netflix zuul?

只谈情不闲聊 提交于 2019-11-28 11:58:09
问题 I'm using netflix zuul embedded in a spring boot 1.5.x application. Behind zuul are some microservices. These microservices expose public endpoints under /public/** . Now i want to expose these public endpoints via zuul api gateway but stripping the "/public" out of the final api gateway url. Example (expected) from outside (request through zuul api gateway): api.yourdomain.tld/path/to/service/endpoint Zuul should forward this request to (with /public in the url): service:{port}/public/path

Eureka and Kubernetes

☆樱花仙子☆ 提交于 2019-11-28 03:35:23
I am putting together a proof of concept to help identify gotchas using Spring Boot/Netflix OSS and Kubernetes together. This is also to proove out related technologies such as Prometheus and Graphana. I have a Eureka service setup which is starting with no trouble within my Kubernetes clouster. This is named discovery and has been given the name "discovery-1551420162-iyz2c" when added to K8 using kubectl run discovery --image=xyz/discovery-microservice --replicas=1 --port=8761 For my config server, I am trying to use Eureka based on a logical URL so in my bootstrap.yml I have server: port:

Using @Headers with dynamic values in Feign client + Spring Cloud (Brixton RC2)

跟風遠走 提交于 2019-11-27 04:21:01
问题 Is it possible to set dynamic values to a header ? @FeignClient(name="Simple-Gateway") interface GatewayClient { @Headers("X-Auth-Token: {token}") @RequestMapping(method = RequestMethod.GET, value = "/gateway/test") String getSessionId(@Param("token") String token); } Registering an implementation of RequestInterceptor adds the header but there is no way of setting the header value dynamically @Bean public RequestInterceptor requestInterceptor() { return new RequestInterceptor() { @Override

Eureka and Kubernetes

一世执手 提交于 2019-11-26 17:35:14
问题 I am putting together a proof of concept to help identify gotchas using Spring Boot/Netflix OSS and Kubernetes together. This is also to proove out related technologies such as Prometheus and Graphana. I have a Eureka service setup which is starting with no trouble within my Kubernetes clouster. This is named discovery and has been given the name "discovery-1551420162-iyz2c" when added to K8 using kubectl run discovery --image=xyz/discovery-microservice --replicas=1 --port=8761 For my config