spring-cloud

Best way to propagate credentials between micro services using spring-session

£可爱£侵袭症+ 提交于 2019-12-07 08:45:49
问题 We are using an architecture very similar to the one described in this great guide on spring.io. Our gateway handles authentication, and sessions are stored in Redis using spring-session. Endpoints of our micro services are secured and also use spring-session. In a micro service I need to call an endpoint of another micro service. I get the URL easily through the discovery client, but I need to provide credentials and I'm not sure of the best way to achieve that. I am thinking about getting

Authentication issue with repo accessed from Spring Cloud Config Server hosted on GitHub

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 07:15:00
问题 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: org.eclipse.jgit.errors.TransportException: https://github.com/my-user/my-repo: Authentication is required but no CredentialsProvider has been registered the property I use to target the repo is spring.cloud.config.server.git.uri=https://github.com/my-user/my-repo What should I do to configure this properly with the private repo, thanks 回答1: you need to add the spring.cloud

Feign client and Spring retry

人走茶凉 提交于 2019-12-07 02:48:41
问题 I have a restful service calling an external service using Spring Cloud Feign client @FeignClient(name = "external-service", configuration = FeignClientConfig.class) public interface ServiceClient { @RequestMapping(value = "/test/payments", method = RequestMethod.POST) public void addPayment(@Valid @RequestBody AddPaymentRequest addPaymentRequest); @RequestMapping(value = "/test/payments/{paymentId}", method = RequestMethod.PUT) public ChangePaymentStatusResponse updatePaymentStatus(

USERAUTH fail with private key file for Github and Spring cloud config

无人久伴 提交于 2019-12-07 02:02:03
问题 I tried to use the method for using private key (that has passphrase and is added to ssh-agent from file) (according to this stack post): spring: cloud: config: server: git: uri: git@github.com-forApp:myorg/myrepo.git search-paths: '{application}' clone-on-start: true private_key_file: ~/.ssh/id_rsa but I keep getting org.eclipse.jgit.api.errors.TransportException: git@github.com:myorg/myrepo.git: USERAUTH fail Do I have to do it exactly as doc says with pasting the key into config file or

spring-cloud-starter-eureka is not resolving when i use Finchley.M5

非 Y 不嫁゛ 提交于 2019-12-07 01:40:18
问题 Trying to create my own api gateway using spring cloud gateway Below is my build.gradle file, buildscript { ext { springBootVersion = "1.5.9.RELEASE" } apply plugin: "io.spring.dependency-management" apply plugin: "org.springframework.boot" dependencies { compile( 'org.springframework.boot:spring-boot-starter-web', 'org.springframework.boot:spring-boot-starter-tomcat', 'org.springframework.boot:spring-boot-starter-actuator', 'org.springframework.boot:spring-boot-starter-webflux', 'org

Spring-Cloud系列第4篇:spring-cloud-Hystrix

大憨熊 提交于 2019-12-07 01:05:36
自学spring-cloud系列,越来越感觉spring-cloud很强大! 主要分为以下几篇: spring-cloud-config: 分布式配置管理 spring-cloud-eureka: 服务注册与发现 spring-cloud-eureka-consumer: 远程服务调用和及其负载均衡 spring-cloud-Hystrix: 熔断器保证服务高可用 spring-cloud-config-eureka-ribbon: 分布式配置管理的高可用 spring-cloud-bus: 配置信息的实时更新 spring-cloud-zuul: 网关基础服务 熔断器介绍 说起springcloud熔断让我想起了去年股市中的熔断,多次痛的领悟,随意实施的熔断对整个系统的影响是灾难性的,好了接下来我们还是说正事。 雪崩效应 在微服务架构中通常会有多个服务层调用,基础服务的故障可能会导致级联故障,进而造成整个系统不可用的情况,这种现象被称为服务雪崩效应。服务雪崩效应是一种因“服务提供者”的不可用导致“服务消费者”的不可用,并将不可用逐渐放大的过程。 如果下图所示:A作为服务提供者,B为A的服务消费者,C和D是B的服务消费者。A不可用引起了B的不可用,并将不可用像滚雪球一样放大到C和D时,雪崩效应就形成了。 熔断器(CircuitBreaker) 熔断器的原理很简单,如同电力过载保护器

Spring-cloud 微服务架构搭建 04 - Hystrix 监控配合turbine的配置使用

不羁的心 提交于 2019-12-07 01:04:27
文章目录 1. Hystrix仪表盘和Turbine集群监控简介 2. hystrix-dashboard-turbine 模块快速搭建 1. Hystrix仪表盘和Turbine集群监控简介 Hystrix仪表盘主要监控hystrix中的各项指标信息,以“桶”和“滚动时间窗的形式”,进行记录保存供外部调用。Hystrix仪表盘可以对单个服务进行监控,暴露hystrix.stream接口,Turbine整合所有服务进行监控。 2. hystrix-dashboard-turbine 模块快速搭建 注:本文项目采用idea工具进行搭建 使用idea自身的spring initializr进行项目的初始化,项目名为:hystrix-dashboard-turbine。 初始化完成项目之后进行pom文件导入 < ! -- turbine 监控启动类 -- > < dependency > < groupId > org . springframework . cloud < / groupId > < artifactId > spring - cloud - starter - netflix - turbine < / artifactId > < / dependency > < ! -- hystrix - dashboard 仪表盘启动类 -- > < dependency >

SpringBoot @SqsListener - not working - with Exception - TaskRejectedException

不问归期 提交于 2019-12-07 01:00:30
问题 I have a AWS SQS with 5000 messages already on the Queue (Sample Message looks like this 'Hello @ 1') I created a SpringBoot Application and inside one of the Component Classes create a method to read messages from the SQS. package com.example.aws.sqs.service; import org.springframework.cloud.aws.messaging.listener.SqsMessageDeletionPolicy; import org.springframework.cloud.aws.messaging.listener.annotation.SqsListener; import org.springframework.stereotype.Component; import lombok.extern

2.spring cloud服务注册中心eureka server---添加Hystrix Dashboard(第四章)

给你一囗甜甜゛ 提交于 2019-12-07 00:31:52
Hystrix Dashboard 本文中示例代码的引用版本: org.springframework.boot 版本 :2.1.0.RELEASE org.springframework.cloud 版本:Greenwich.M1 示例代码-码云 https://gitee.com/sharps/springcloud 我们在熔断示例项目spring-cloud-consumer-hystrix的基础上更改,重新命名为:spring-cloud-consumer-hystrix-dashboard。 1、添加依赖 org.springframework.boot 版本 :2.1.0.RELEASE org.springframework.cloud 版本:Greenwich.M1 < dependency > < groupId > org.springframework.cloud </ groupId > < artifactId > spring-cloud-starter-netflix-eureka-client </ artifactId > </ dependency > < dependency > < groupId > org.springframework.cloud </ groupId > < artifactId > spring-cloud

Cannot disable Spring Cloud Config via spring.cloud.config.enabled:false

孤街醉人 提交于 2019-12-06 21:36:03
问题 Let me preface this by saying that I'm not using Spring Cloud Config directly, it is transitive via Spring Cloud Hystrix starter. When only using @EnableHystrix , Spring Cloud also tries to locate a configuration server, expectedly unsuccessfully, since I'm not using one. The application works just fine, as far as I can tell, but the problem is in the status checks. Health shows DOWN because there is no config server. Browsing the source of the project, I'd expect spring.cloud.config.enabled