spring-cloud

Netflix Eureka and 2 instances of application on local environment

余生颓废 提交于 2019-12-03 20:37:12
I'm getting started with Netflix Eureka and using its 1.1.145 ( https://github.com/Netflix/eureka/tree/1.1.145 ) version. I want to start locally 2 instances of the same application on different ports and have them both registered with Eureka. I'm using sample service ( https://github.com/Netflix/eureka/blob/1.1.145/eureka-server/conf/sampleservice/sample-eureka-service.properties ) So I start Eureka itself and 2 instances using above config - one app on 8001 port and another on 8002. For some reason I'm getting only one instance registered with Eureka at any given time. Both of them start

Spring plan for Zuul 2

前提是你 提交于 2019-12-03 17:18:11
I've heard that Zuul 2 is released. Are there any plan of updating Spring for it? I can't wait. I applied Spring cloud to build a microservice system and think they are awesome. So, Zuul 2 makes me feel excited. As far as I can tell Zuul 2 has not been released . We are in the process of releasing Zuul 2 as open source. Once it is released... That being said, given enough lead time, we plan on integrating zuul 2 in the beginning of 2017. There's now spring-cloud-gateway . Which is Spring's replacement for Zuul 1. https://spring.io/blog/2017/07/06/spring-cloud-finchley-m1-is-available "Spring

Spring Cloud OAuth2: Resource server with multiple Authorization server

笑着哭i 提交于 2019-12-03 17:02:36
We are developing an application in a microservice architecture, which implements signle sign-on using Spring Cloud OAuth2 on multiple OAuth2 providers like Google and Facebook. We are also developing our own authorization server, and will be integrated on next release. Now, on our microservices, which are resource servers, I would like to know how to handle multiple token-info-uri or user-info-uri to multiple authorization servers (e.g. for Facebook or Google). This type of situation is generally solved by having a middle-man; a single entity that your resource servers trust and that can be

@RefreshScope and /refresh not working

孤街浪徒 提交于 2019-12-03 16:39:25
I have tried to implement spring external configurations using Config Server. It is working fine for the very first time when the application is started but any changes to the properties file are not being reflected. I tried to use /refresh endpoint to refresh my properties on the fly but it doesn't seem to be working. Any help on this would be greatly helpful. I tried POSTing to localhost:8080/refresh but getting a 404 Error response. Below is the code of my application class @SpringBootApplication public class Config1Application { public static void main(String[] args) { SpringApplication

Eureka服务注册中心错误:com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect

孤街醉人 提交于 2019-12-03 14:30:57
报错信息 14:43:45.484 [main] INFO com.netflix.discovery.DiscoveryClient - Getting all instance registry info from the eureka server 14:43:46.690 [main] ERROR com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient - Request execution error com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter

Unreachable security context using Feign RequestInterceptor

我是研究僧i 提交于 2019-12-03 14:22:34
The goal is to attach some data from security context using RequestInterceptor, but the problem, that the calling SecurityContextHolder.getContext().getAuthentication() always returns null even though it is not null (I am sure 100%). As I understand that's because the Interceptor is created and is being run in other thread. How could I solve this problem and get actual data from security context? My service: @FeignClient(value = "api", configuration = { FeignConfig.class }) public interface DocumentService { @RequestMapping(value = "/list", method = RequestMethod.GET) DocumentListOperation

Authorization header not passed by ZuulProxy starting with Brixton.RC1

假如想象 提交于 2019-12-03 14:21:21
In switching from Spring Cloud Brixton.M5 to Brixton.RC1 my ZuulProxy no longer passes Authorization headers downstream to my proxied services. There's various actors in play in my setup, but most all of them are fairly simple: - AuthorizationServer: runs separately; hands out JWTs to clients - Clients: get JWTs from OAuth server; each with access to a subset of resources. - ResourceServers: consume JWTs for access decisions - MyZuulProxy: proxies various resource servers; should relay JWTs. It should be noted that MyZuulProxy has no security dependencies whatsoever; It passed the

NoSuchMethodError: com.google.common.collect.MapMaker.keyEquivalence

南楼画角 提交于 2019-12-03 14:16:09
今天项目整合遇到的一个bug C:\Java\jdk1.8\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:C:\JetBrains\IntelliJ IDEA 2019.1.1\lib\idea_rt.jar=5896:C:\JetBrains\IntelliJ IDEA 2019.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Java\jdk1.8\jre\lib\charsets.jar;C:\Java\jdk1.8\jre\lib\deploy.jar;C:\Java\jdk1.8\jre\lib\ext\access-bridge-64.jar;C:\Java\jdk1.8\jre\lib\ext\cldrdata.jar;C:\Java\jdk1.8\jre\lib\ext\dnsns.jar;C:\Java\jdk1.8

Sticky Sessions and Zuul in Spring Cloud

孤人 提交于 2019-12-03 13:46:34
问题 I have a set of micro services and we use zuul for routing from the front end as a way of mapping a uri context path to a specific micro service using spring cloud. Internally and externally we use spring OAuth2 and that works quite well. However, for one specific service there has arisen a requirement for SAML and this imposes a sticky sessions requirement for that service. Has another considered this and what would eb the correct way to put in sticky session support for zuul. As a work

Session not replicated on session creation with Spring Boot, Session, and Redis

独自空忆成欢 提交于 2019-12-03 13:44:27
问题 I'm attempting to implement a microservices architecture using Spring Cloud's Zuul, Eureka, and my own services. I have multiple services that have UIs and services and each can authenticate users using x509 security. Now I'm trying to place Zuul in front of those services. Since Zuul can't forward client certs to the backend, I thought the next best thing would be to authenticate the user at the front door in Zuul, then use Spring Session to replicate their authenticated state across the