spring-cloud

Zuul -> Eureka Server, Basic Authentication issue

谁都会走 提交于 2019-12-22 05:34:29
问题 I am able to hit the service, if the flow doesn't contain Basic Authorization. If i use Basic Authorization, it throws "message": "Full authentication is required to access this resource" Below are my observations: In ZuulFilter, run() method, i get value for request.getHeader("Authorization") --> Basic c29tOnNvbzz== but once it reaches the Micro Service, i am getting value as 'null', request.getHeader("Authorization") --> null Using Spring Boot version : 1.4.0.RELEASE This is my flow: ------

Can i have more than one Spring Cloud Config Server?

ε祈祈猫儿з 提交于 2019-12-22 05:34:13
问题 I understand that i can use more than 1 repositories to distribute my configurations across multiple repositories (probably for each application) but, can I run more than 1 Config servers for these repositories , so that we can avoid a single point of failure a the 'Config Server' . If we can run multiple config servers, how do i abstract my client's from accessing any one particular config server ? Update (after further reading): instead of using IP in the URI, if i use a URL which load

Spring Cloud - SQS - The specified queue does not exist for this wsdl version

非 Y 不嫁゛ 提交于 2019-12-22 02:05:22
问题 I am attempting to get spring cloud to work with messaging using auto configure. My properties file contains: cloud.aws.credentials.accessKey=xxxxxxxxxx cloud.aws.credentials.secretKey=xxxxxxxxxx cloud.aws.region.static=us-west-2 My Configuration class is as follows: @EnableSqs @ComponentScan @EnableAutoConfiguration public class Application { public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } } My Listener class: @RestController public

Zuul and Consul integration issue

只谈情不闲聊 提交于 2019-12-22 01:29:55
问题 I have problem setting up Spring Cloud application with Zuul and Consul service discovery. I have Consul server agent installed and running locally: ./src/main/bash/local_run_consul.sh When I run Spring Boot application with @EnableZuulProxy annotation I get the following error: Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.netflix.zuul.filters.RouteLocator]: Factory method 'routeLocator' threw exception; nested exception is

How to set up Spring Cloud Gateway application so it can use the Service Discovery of Spring Cloud Kubernetes?

99封情书 提交于 2019-12-21 23:37:26
问题 I created two Spring Boot applications which both will be deployed in a Kubernetes cluster. One of those apps will act as a gateway and therefore uses Spring Cloud Gateway as a dependency. Also I want to integrate service discovery with Spring Cloud Kubernetes and that the gateway uses the service discovery to automatically generate corresponding routes. But when I expose the gateway application, which is running in an local Minikube cluster, and invoke the second app/service I get a 503

consul first bootstrap with spring cloud config

若如初见. 提交于 2019-12-21 21:33:26
问题 Iam using spring-cloud-config for centralized configuration and consul for service discovery. Like eureka first bootstrap - does spring support consul first bootstrap i.e on booting up a client service - I should look up the config server through consul. The otherway round works perfectly fine i.e - in config client bootstrap.properties - I provide the spring.cloud.config.uri =http://localhost:8888 which located the config server and pulls config from it. And in the config repository for my

Spring-Cloud学习之Eureka集群搭建

痴心易碎 提交于 2019-12-21 21:05:17
一.为什么需要集群 上一篇文章讲解了如何搭建单个节点的eureka,这篇讲解如何搭建eureka集群,这里的集群还是本地不同的端口执行三个eureka,因为条件不要允许,没有三台电脑,所以大家将就一下吧,eureka集群的目的就是防止一个点故障导致,整个服务瘫痪的问题,成为单点故障,因为一个点出问题,还有另一个点顶上去,代替这个点工作,所以集群也实现了高可用、高性能 二.集群的原理 每一个注册点都配置有其它点的url,能够与其他server点进行数据的同步,当服务向一个点注册时,该店就会把该服务同步到其它注册点,当消费者需要消费时就会向注册中心询问具体的服务,注册中心就会向消费者提供具体的提供该服务的服务提供者的访问地址,最后实现服务的调用 三.创建集群win环境配置 这里方便就直接把所有的服务都泡在本地的win10环境中,本来真正模拟环境是要在linux的虚拟机上跑的,大家可以自行百度,原理都一样的,只不过跑在linux上需要打包发布,我就直接在win上操作了。首先本地跑多个服务配置一下,域名映射,在C:\Windows\System32\drivers\etc路径下的hosts文件中加入: 127.0.0.1 eureka3000.com 127.0.0.1 eureka3001.com 127.0.0.1 eureka3002.com 这里需要提醒的是

Spring-Cloud 学习笔记-(2)项目搭建

时光毁灭记忆、已成空白 提交于 2019-12-21 20:10:06
目录 Spring-Cloud 学习笔记-(2)项目搭建 1、环境介绍 2、主项目搭建 2.1.新建一个Maven项目作为主项目 2.2.填写项目信息 2.3.pom文件引入依赖 2.4.导入依赖 3、服务提供者 3.1.新建一个Module 3.2.修改pom文件 3.2.创建spring-boot启动类 3.3.创建测试类 3.4.测试效果 3.5.编写模拟获取用户信息代码 4、服务消费者 4.1.根据上面方法创建一个消费者Module 4.2.编写代码 4.3.测试 5、RestTemplate的使用 5.1.修改代码 5.2.测试 Spring-Cloud 学习笔记-(2)项目搭建 1、环境介绍 [ ] 操作系统:windows [ ] JDK版本:1.8 [ ] Spring-Boot版本:2.1.1.RELEASE [ ] Spring-Cloud版本:Finchley.SR2 2、主项目搭建 2.1.新建一个Maven项目作为主项目 2.2.填写项目信息 2.3.pom文件引入依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Securing Eureka in Spring cloud

亡梦爱人 提交于 2019-12-21 17:45:00
问题 I am curious about what options I have for securing a service connecting (registering and getting disco info) to eureka. Obviously I want to turn security on in Eureka and specify a username password for service. One question that I have is how do services trying to connect to eureka specify their credentials? Is it through the specification of the zone and what is the format of this reference? *** I actually the answer to the above question and posted below, But still wonder about the

spring boot 2.0.3+spring cloud (Finchley)6、配置中心Spring Cloud Config

隐身守侯 提交于 2019-12-21 13:10:28
Spring Cloud Config 是用来为分布式系统中的基础设施和微服务应用提供集中化的外部配置支持,它分为服务端与客户端两个部分。其中服务端也称为分布式配置中心,它是一个独立的微服务应用,用来连接配置仓库并为客户端提供获取配置信息、加密 / 解密信息等访问接口;而客户端则是微服务架构中的各个微服务应用或基础设施,它们通过指定的配置中心来管理应用资源与业务相关的配置内容,并在启动的时候从配置中心获取和加载配置信息。Spring Cloud Config 实现了对服务端和客户端中环境变量和属性配置的抽象映射,所以它除了适用于 Spring 构建的应用程序之外,也可以在任何其他语言运行的应用程序中使用。由于 Spring Cloud Config 实现的配置中心默认采用 Git 来存储配置信息,所以使用 Spring Cloud Config 构建的配置服务器,天然就支持对微服务应用配置信息的版本管理,并且可以通过 Git 客户端工具来方便的管理和访问配置内容。当然它也提供了对其他存储方式的支持,比如:SVN 仓库、本地化文件系统。 Config Server从本地读取配置文件 本地仓库是指将所有的配置文件统一写在Config Server工程目录下。config server暴露Http API接口,config client通过调用config server的Http