spring-cloud

spring-cloud-starter-consul-config 和 spring-cloud-consul-config 区别是什么?从网上没有搜到答案,待跟进。

走远了吗. 提交于 2019-11-30 15:52:44
待解决问题:此处依赖需要用 spring-cloud-consul-config,用 spring-cloud-starter-consul-config 会提示找不到;那 spring-cloud-starter-consul-config 和 spring-cloud-consul-config 区别是什么?从网上没有搜到答案,待跟进。 问题来自: https://github.com/cag2050/spring_cloud_consul_producer1_demo 来源: https://www.cnblogs.com/cag2050/p/11602449.html

Why is AccessTokenRequest's PreservedState perpetually null with a resultant CSRF related InvalidRequestException?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 15:39:37
As context, I've been trying to get a fairly simple @SprintBootApplication with an additional @EnableOAuth2Sso annotation integrated with WSO2 Identity Server for quite some time now. In my mind getting this working should be a matter of configuration (as advertised on Spring Cloud Security ) - but I've had no luck thus far. In an effort to understand what is going on I've used my debugger to step through spring-security-oauth2 code to figure out what is going on. In doing so I've noticed that my AccessTokenRequest's PreservedState is perpetually null with a resultant CSRF related

Spring Cloud - Getting Retry Working In RestTemplate?

半城伤御伤魂 提交于 2019-11-30 15:17:30
I have been migrating an existing application over to Spring Cloud's service discovery, Ribbon load balancing, and circuit breakers. The application already makes extensive use of the RestTemplate and I have been able to successfully use the load balanced version of the template. However, I have been testing the situation where there are two instances of a service and I drop one of those instances out of operation. I would like the RestTemplate to failover to the next server. From the research I have done, it appears that the fail-over logic exists in the Feign client and when using Zuul. It

Unable to connect to Command Metric Stream for Hystrix Dashboard with Spring Cloud

橙三吉。 提交于 2019-11-30 15:16:28
I have microservices project with Spring Cloud, the snippet from parent: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.7.RELEASE</version> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Dalston.SR3</version> <type>pom</type> <scope>import</scope> </dependency> All services are running under Eureka server: All services are running fine. I can call make appropriate calls with Postman and everything works

How to establish relationships between Spring Data REST / Spring HATEOAS based (micro) services?

不羁岁月 提交于 2019-11-30 14:03:59
Trying to figure out a pattern for how to handle relationships when using a hypermedia based microservices based on Spring Data Rest or HATEOAS. If you have service A (Instructor) and Service B (Course) each exist as an a stand alone app. What is the preferred method for establishing a relationship between the two services. In a manner that does not require columns for IDs of the foreign service. It would be possible for each service to have many other services that need to communicate in the same manor. Possible solution (Not sure a correct path) Each service has a second table with a

How to implement a microservice Event Driven architecture with Spring Cloud Stream Kafka and Database per service

蓝咒 提交于 2019-11-30 13:26:40
问题 I am trying to implement an event driven architecture to handle distributed transactions. Each service has its own database and uses Kafka to send messages to inform other microservices about the operations. An example: Order service -------> | Kafka |------->Payment Service | | Orders MariaDB DB Payment MariaDB Database Order receives an order request. It has to store the new Order in its DB and publish a message so that Payment Service realizes it has to charge for the item: private

Spring OAuth: Resource Server with Authorization Server backend

本小妞迷上赌 提交于 2019-11-30 13:21:43
问题 I want to develop two independent services, one for the business stuff and one for the user authentication using Spring OAuth 2 Let's call them Business-Service and OAuth-Service. Now I want the Business-Service delegate to the OAuth-Service if a request is not authenticated. The client application (an Android app) should not know about the OAuth-Service a priori, it should only be delegated to it by the Business-Service with an 302 HTTP redirect for non-authenticated request. To be precise,

OAuth2ClientContext (spring-security-oauth2) not persisted in Redis when using spring-session and spring-cloud-security

别来无恙 提交于 2019-11-30 13:21:35
问题 Thanks a lot in advance for reading this question. Setup I am using: spring-security-oauth2:2.0.7.RELEASE spring-cloud-security:1.0.1.RELEASE spring-session:1.0.1.RELEASE and would have a question regarding the persistence of spring-security-oauth2 OAuth2ClientContext in a Redis datastore when using spring-session (via @EnableRedisHttpSession ) in a Single-Sign-On ( @EnableOAuth2Sso ), reverse proxy ( @EnableZuulProxy ) gateway. Problem It seems to me that the SessionScoped

SpringCloud之Turbine

拜拜、爱过 提交于 2019-11-30 13:16:53
【 前面的话 】书接上文,本文的某些知识依赖我的上一篇SpringCLoud的文章: SpringCloud之Feign ,如果没有看过可以先移步去看一下。前文提到了hystrix的应用,以及hystrix的监控,当时我们在实际生产过程中往往会在多个服务中或者说网关集群中使用hystrix,这样我们来监控的是否再去分别查看当时的每个应用的话,效率就会显得很低下呢,这里我们就要用的上文提到的集群监控了。 壹、Turbine的简介 看单个的Hystrix Dashboard的数据并没有什么多大的价值,要想看这个系统的Hystrix Dashboard数据就需要用到Hystrix Turbine。Hystrix Turbine将每个服务Hystrix Dashboard数据进行了整合。Hystrix Turbine的使用非常简单,只需要引入相应的依赖和加上注解和配置就可以了。 简而言之:Turbine就是聚合监控多个Hystrix Dashboard的数据。 贰、准备工作 新建一个feign子工程 lovin-cloud-turbine ,用于后面的操作。下面是主要的pom依赖: <parent> <artifactId>lovincloud</artifactId> <groupId>com.eelve.lovincloud</groupId> <version>1.0

Zuul/Ribbon/Hystrix not retrying on different instance

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 13:05:37
Background I'm using Spring cloud Brixton.RC2, with Zuul and Eureka. I have one gateway service with @EnableZuulProxy and a book-service with a status method. Via configuration I can emulate work on the status method by sleeping a defined amount of time. The Zuul route is simple zuul.routes.foos.path=/foos/** zuul.routes.foos.serviceId=reservation-service I run two instances of the book-service . When I set the sleeping time below the Hystrix timeout threshold (1000ms) I can see requests going to both instance of the book services. This works well. Problem I understand that if the Hystrix