spring-cloud

How to provide custom security configuration for oauth2 with spring-boot 1.3.0.RC1

折月煮酒 提交于 2019-12-02 11:43:40
With spring-cloud Angel.SR3 release I followed example in https://github.com/spring-cloud-samples/sso and things work fine with spring-boot 1.2.6.RELEASE. However with spring-boot 1.3.0.RC1, the oauth2 stuff has moved into spring-boot itself, and the code below fails to compile because class OAuth2SsoConfigurerAdapter no longer exists. What is the spring-boot only way to create equivalent configuration? public static void main(String[] args) { SpringApplication.run(MainAppApplication.class, args); } ... @Component public static class LoginConfigurer extends OAuth2SsoConfigurerAdapter {

How to set local config properties with Spring Config Service

点点圈 提交于 2019-12-02 09:39:37
问题 So I recently learned this awesome config service of Spring Cloud, and after some struggling I'm able to get our distributed application set up, with multiple nodes reading config properties from one config server. However one problem I don't know how to resolve is even though most props are same across multiple nodes, some props need local version and I don't know how to set local prop together with config service. For example this is my bootstrap.properties , spring.cloud.config.uri=$

Docker - SpringConfig - Connection refused to ConfigServer

依然范特西╮ 提交于 2019-12-02 09:31:28
I'm trying to deploy a ConfigServrService and a Client with a remote repository using DockerCompose. The docker-compose.yml is like: version: '2' services: rabbitmq: image: rabbitmq ports: - "5672:5672" config-server: image: config-server environment: - "SPRING_PROFILES_ACTIVE=desa" ports: - "8888:8888" links: - rabbitmq depends_on: - rabbitmq user-service-config: image: user-service-config environment: - "SPRING_PROFILES_ACTIVE=desa" ports: - "8090:8090" links: - config-server - rabbitmq depends_on: - rabbitmq - config-server At the moment that they are deploying, the client console shows: c

SpringCloud-使用路由网关统一访问接口(附代码下载)

▼魔方 西西 提交于 2019-12-02 06:48:49
场景 SpringCloud-使用熔断器仪表盘监控熔断: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102673599 SpringCloud -创建统一的依赖管理: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102530574 上面在实现了使用熔断仪表盘进行监控熔断后,使用路由网关统一访问接口。 API网关 API网关负责请求路由、组合和协议转发。所有的客户端请求首先要通过API网关,之后请求被路由到适当的服务。 API网关通常会调用多个微服务和聚合结果来处理一个请求。它可以在Web协议(如HTTP和WebSocket)和利用于内部的非Web友好协议之间进行转换。 负载均衡方式 在Spring Cloud微服务系统中,一种常见的负载均衡方式是:客户端的请求先经过负载均衡(Zuul、Nginx),再到达服务网关(Zuul集群),然后再到具体的服务。服务统一注册到高可用的服务注册中心集群,服务的所有的配置文件放在Git仓库,方便开发人员随时改配置。 Zuul简介 Zuul的主要功能是路由转发和过滤器。路由功能是微服务的一部分。 Zuul默认和Ribbon结合实现了负载均衡的功能。 注: 博客: https://blog.csdn.net

How to set local config properties with Spring Config Service

此生再无相见时 提交于 2019-12-02 04:27:29
So I recently learned this awesome config service of Spring Cloud, and after some struggling I'm able to get our distributed application set up, with multiple nodes reading config properties from one config server. However one problem I don't know how to resolve is even though most props are same across multiple nodes, some props need local version and I don't know how to set local prop together with config service. For example this is my bootstrap.properties , spring.cloud.config.uri=${config.server:http://localhost:8888} spring.application.name=worker If I add additional props under

Java Spring Boot: Reload config without spring cloud config server

拟墨画扇 提交于 2019-12-02 03:12:05
I am trying to reload configuration of my application during runtime. The configuration is in a yaml file and the binding with @ConfigurationProperties works as expected. Next thing is. I want to reload the config when the yaml has changed. Or rather I am checking with @Scheduled whether the file has changed. I would like to avoid running a second server for having my Environment update. The two questions I have: How do I update the environment, ConfigurableEnvironment maybe? How do I propagate these? Spring cloud config documentation states: The EnvironmentChangeEvent covers a large class of

Spring-Cloud-Eureka实例

佐手、 提交于 2019-12-02 02:45:26
spring.application.name=spring-cloud-eureka server.port=8000 eureka.instance.hostname=peer1 eureka.client.serviceUrl.defaultZone=http://peer2:8001/eureka/ SpringCloud实现服务注册中心 注册中心这么关键的服务,如果是单点话,遇到故障就是毁灭性的。在一个分布式系统中,服务注册中心是最重要的基础部分,理应随时处于可以提供服务的状态。为了维持其可用性,使用集群是很好的解决方案。Eureka通过互相注册的方式来实现高可用的部署,所以我们只需要将Eureke Server配置其他可用的serviceUrl就能实现高可用部署。 实例结构如下图所示,服务中心双机部署(模仿集群)。 双节点注册中心 1、创建application-peer1.properties,作为peer1服务中心的配置,并将serviceUrl指向peer2 spring.application.name=spring-cloud-eureka server.port=8000 eureka.instance.hostname=peer1 eureka.client.serviceUrl.defaultZone=http://peer2:8001/eureka/

springColud父工程依赖配置

旧巷老猫 提交于 2019-12-02 02:17:49
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.7.RELEASE</version> <relativePath/> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <junit.version>4.12</junit.version> <spring-cloud.version>Finchley.SR2</spring-cloud.version> </properties> <!--依赖声明--> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies<

Spring Cloud Alibaba(二) 配置中心多项目、多配置文件、分目录实现

风流意气都作罢 提交于 2019-12-02 02:13:18
介绍 之前 Spring Cloud Config基础篇 这篇文章介绍了Spring Cloud Config 配置中心基础的实现,今天继续聊下Spring Cloud Config 并结合nacos做服务注册中心,实现多项目、多配置文件、按项目目录划分等功能的配置服务中心。 阅读本篇文章之前,最好要有nacos基础;关于nacos是什么,如何使用,可以参考我的上一篇文章 Spring Cloud Alibaba(一) 如何使用nacos服务注册和发现 ,或者直接链接到官网教程 Nacos 快速开始 本示例主要内容 采用nacos做服务注册中心,Spring Cloud Config做配置服务中心,在上一篇基础上新建了ali-nacos-config-server配置服务中心项目、ali-nacos-config-client配置客户端项目、并把ali-nacos-consumer-feign配置也调整成从配置中心加载配置 支持多项目,config-repo配置文件目录按项目名称来规划,在配置中心 searchPaths: /cloud-alibaba/config-repo/{application}/ 使用application自动识别查找目录 支持单项目多配置文件,ali-nacos-config-client项目的配置文件 spring.cloud.config.name=

SpringBoot: FeignClient with SSL (p12)

谁说我不能喝 提交于 2019-12-01 20:51:57
问题 I'm trying to create a FeignClient for one external HTTP API which uses SSL. The struggle is - how to modify default Spring FeignClient with my logic, in this case SSL Connection Factory. So basically I wanna keep all the good things Spring automatically does for the FeignClients, like Hystrix, Sleuth tracing, etc and make it work with my SSL factory. Will appreciate any suggestions. Here is what I tried to do: I've tried to provide a custom @Configuration outside of ComponentScan: