spring-cloud

Abstracting Spring Cloud Stream Producer and Consumer code

≯℡__Kan透↙ 提交于 2020-05-17 05:52:18
问题 I have a Service that is Producing and Consuming messages from different Spring Cloud Stream Channels (bound to EventHub/Kafka topics). There are several such Services which are setup similarly. The configuration looks like below public interface MessageStreams { String WORKSPACE = "workspace"; String UPLOADNOTIFICATION = "uploadnotification"; String BLOBNOTIFICATION = "blobnotification"; String INGESTIONSTATUS = "ingestionstatusproducer"; @Input(WORKSPACE) SubscribableChannel

Specifying route URI in Spring Cloud Gateway Configuration

自古美人都是妖i 提交于 2020-05-14 02:48:31
问题 Here is the yml for spring cloud gateway. I want to write URI without load balancing. But as I'm using Eureka, I don't think hardcoding something like "localhost:6678" is a good idea. I would like to specify the service name, without the lb prefix. Any way to write it ? spring: cloud: gateway: routes: - id: before_route uri: lb://hello-service I'm seeing this on the console when I run the gateway: You already have RibbonLoadBalancerClient on your classpath. It will be used by default. As

Specifying route URI in Spring Cloud Gateway Configuration

╄→尐↘猪︶ㄣ 提交于 2020-05-14 02:44:48
问题 Here is the yml for spring cloud gateway. I want to write URI without load balancing. But as I'm using Eureka, I don't think hardcoding something like "localhost:6678" is a good idea. I would like to specify the service name, without the lb prefix. Any way to write it ? spring: cloud: gateway: routes: - id: before_route uri: lb://hello-service I'm seeing this on the console when I run the gateway: You already have RibbonLoadBalancerClient on your classpath. It will be used by default. As

Setting Hystrix timeout with environment variable

被刻印的时光 ゝ 提交于 2020-05-13 03:57:05
问题 In order to change Hystrix's default request timeout (1000ms), one must set the following property : hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=2000 What is the corresponding environment variable ? I would like to "tune" the timeout on my favorite cloud platform without touching the source code first. I'm pretty sure this one doesn't work : HYSTRIX_COMMAND_DEFAULT_EXECUTION_ISOLATION_THREAD_TIMEOUT_IN_MILLISECONDS=2000 EDIT : Problem was found with Spring Cloud

How to make API Gateway Stateless for Authentication/Authorization Process Using Oauth2?

僤鯓⒐⒋嵵緔 提交于 2020-04-30 05:48:07
问题 In my design I have an API gateway (spring cloud api gateway), authorization server (Oauth2) and a resource server (microservice). (I have also a CAS server but now it can be ignored for simplicity) I just want to use API gateway to redirect client requests. If the user is not authenticated, request should be sent to authorization server and after authentication and authorization process is finished, authorization server should return JSESSION and JWT in access_token header. After that API

How to make API Gateway Stateless for Authentication/Authorization Process Using Oauth2?

北城以北 提交于 2020-04-30 05:48:05
问题 In my design I have an API gateway (spring cloud api gateway), authorization server (Oauth2) and a resource server (microservice). (I have also a CAS server but now it can be ignored for simplicity) I just want to use API gateway to redirect client requests. If the user is not authenticated, request should be sent to authorization server and after authentication and authorization process is finished, authorization server should return JSESSION and JWT in access_token header. After that API

华为云 ServiceStage 正式加入 Spring 生态大家族!

纵饮孤独 提交于 2020-04-07 15:42:25
本文介绍最近开源的 spring-cloud-huawei 背景、定义、优势和使用方法,带你两分钟搞定SpringCloud应用与 ServiceComb 引擎对接。 为什么会有spring-cloud-huawei? 很多人会使用SpringCloud开发框架进行应用开发,再使用 ServiceStage 进行微服务治理、配置管理、契约管理等微服务增值功能。但一直以来,SpringCloud应用接入ServiceComb引擎的开发难度大。spring-cloud-huawei的出现就是为了解决这个问题,他将SpringCloud应用和云产品进行轻松对接,提供云服务接入能力并获取全场景微服务能力。 什么是spring-cloud-huawei? spring-cloud-huawei 基于 Spring Boot 和 Spring Cloud 的相关扩展机制开发。通过 spring-cloud-huawei , Spring Cloud 应用可以无改动零侵入式对接 ServiceComb 引擎。 同时,还具备天然的优势轻松接入华为云 ServiceStage 服务,在开发过程中享受服务治理、契约管理、流量管理和服务网格以及配置管理等全场景特性。 spring-cloud-huawei有什么优势? API FIRST :符合 Open API 标准的契约,提供契约管理、契约注册等特性

io.grpc.StatusRuntimeException: PERMISSION_DENIED: User not authorized to perform this action

纵饮孤独 提交于 2020-04-05 06:48:12
问题 I try to implement simple example of spring cloud config + spring cloud bus . So I've implemented Client server application Config server application and in the separated repository I've put application.properties file. Looks like everything is correct on the server side. But on client side I see error when application is starting: org.springframework.cloud.stream.binder.BinderException: Exception thrown while building outbound endpoint at org.springframework.cloud.stream.binder

io.grpc.StatusRuntimeException: PERMISSION_DENIED: User not authorized to perform this action

我与影子孤独终老i 提交于 2020-04-05 06:48:08
问题 I try to implement simple example of spring cloud config + spring cloud bus . So I've implemented Client server application Config server application and in the separated repository I've put application.properties file. Looks like everything is correct on the server side. But on client side I see error when application is starting: org.springframework.cloud.stream.binder.BinderException: Exception thrown while building outbound endpoint at org.springframework.cloud.stream.binder

How to “remove the gobal prefix('/api') then goto the lb:// ” when migrate to spring cloud gateway from zuul

隐身守侯 提交于 2020-03-18 10:16:15
问题 I want to Migrating from zuul to spring cloud gateway, I don't want to change my config of previous app. I want to know how to handle with the url with "/api/ + 'serviceId'", route to lb://serviceId the previous zuul config zuul: prefix: /api there are lots of service regist to eureka ,i don't want to config a route for each one. eg. the auto generated route by org.springframework.cloud.gateway.discovery.DiscoveryClientRouteDefinitionLocator { "route_id": "CompositeDiscoveryClient_APIGATEWAY"