spring-cloud

Forbid Unauthenticated requests in Spring Cloud Gateway

三世轮回 提交于 2021-02-08 16:37:34
问题 I have implemented custom pre filter in spring cloud gateway which allows authenticated requests to go through the downstream process. What I want is if the request is unauthenticated then return with response of 401 UNAUTHORIZE status and stop the downstream processing. Can I achieve this spring cloud gateway. Please help. My filter code is below public class ValidUserFilter implements GatewayFilterFactory { @Override public GatewayFilter apply(Object config) { return (exchange, chain) -> {

Spring Cloud Data Flow Grafana Prometheus not showing stream data

江枫思渺然 提交于 2021-02-08 15:12:38
问题 I launch Spring cloud data flow with docker-compose base on this website. https://dataflow.spring.io/docs/installation/local/docker/ I created 3 apps, Source, Processor & Sink. I ran export STREAM_APPS_URI=https://dataflow.spring.io/Einstein-BUILD-SNAPSHOT-stream-applications-kafka-maven When I run docker-compose -f ./docker-compose.yml -f ./docker-compose-prometheus.yml up, all my containers start up as specified in the docker-compose.yml and docker-compose-prometheus.yml. I proceed to

Spring Cloud Data Flow Grafana Prometheus not showing stream data

情到浓时终转凉″ 提交于 2021-02-08 15:12:06
问题 I launch Spring cloud data flow with docker-compose base on this website. https://dataflow.spring.io/docs/installation/local/docker/ I created 3 apps, Source, Processor & Sink. I ran export STREAM_APPS_URI=https://dataflow.spring.io/Einstein-BUILD-SNAPSHOT-stream-applications-kafka-maven When I run docker-compose -f ./docker-compose.yml -f ./docker-compose-prometheus.yml up, all my containers start up as specified in the docker-compose.yml and docker-compose-prometheus.yml. I proceed to

Zuul CORS filter doesn't work

徘徊边缘 提交于 2021-02-08 12:10:13
问题 So, basically, the front-end uses reactJS, the back-end Spring Boot (microservices, with zuul acting as the gateway), and of course they can't do anything without CORS stuff. We used this piece of code @Bean public CorsFilter corsFilter() { final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); final CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); config.addAllowedOrigin("*"); config.addAllowedHeader("*"); config

Zuul CORS filter doesn't work

 ̄綄美尐妖づ 提交于 2021-02-08 12:06:26
问题 So, basically, the front-end uses reactJS, the back-end Spring Boot (microservices, with zuul acting as the gateway), and of course they can't do anything without CORS stuff. We used this piece of code @Bean public CorsFilter corsFilter() { final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); final CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); config.addAllowedOrigin("*"); config.addAllowedHeader("*"); config

How to manage Feign errors?

徘徊边缘 提交于 2021-02-07 18:18:21
问题 We are using Spring-boot with Spring-cloud and Spring-cloud-netflix with Spring-cloud-feign . We are creating our Gateway application that with the help of Feign will try to communicate with our authentication microservice in order to validate their credentials. Here you can see an example of our Feign authentication client: @FeignClient(value="auth", configuration = AuthClientConfiguration.class) public interface AuthClient { @RequestMapping(method = RequestMethod.GET, value = "/tokens",

Turbine Dashboard Is not Loading for Aggregation in Spring Cloud Microservice

大憨熊 提交于 2021-02-07 11:23:06
问题 I am trying to develop a spring cloud microservice using spring MVC and spring boot framework. And Eureka server , Zuul , Ribbon , hystrix and Turbine using for spring cloud. I already developed a microservice and implemented only hystrix dashboard. I am able to take hystrix dashboard. Now I am implementing more services. So I choosed turbine for aggregation of monitoring. But it not getting the dashboard.I implemented turbine in separate spring boot project. My pom.xml containing,

Spring Config-Client doesn't refresh if Config-Server is down during initial startup

折月煮酒 提交于 2021-02-07 04:33:05
问题 I am running a test with a barebones Spring cloud config-server and a client-application. I executed a refresh scenario (by calling /refresh endpoint on the client-application) after config-server was down initially. Here is what I found Client starts up with locally packaged properties when config-server is not reachable on startup. (I have the properties in application.yml that is bundled with client-application) Git backend has different values for the properties compared to locally

Ribbon with Spring Cloud and Eureka java.lang.IllegalStateException: No instances available for localhost

左心房为你撑大大i 提交于 2021-02-07 04:15:45
问题 I am using <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-netflix</artifactId> <version>1.2.3.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> My main class: @SpringBootApplication //@Configuration @ComponentScan(basePackages = "com.mypackage") @EnableAutoConfiguration @EnableEurekaClient @EnableSwagger2 public class App { public static void main( String[] args ) { SpringApplication.run(App.class, args); } @LoadBalanced @Bean(name=

Ribbon with Spring Cloud and Eureka java.lang.IllegalStateException: No instances available for localhost

核能气质少年 提交于 2021-02-07 04:13:28
问题 I am using <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-netflix</artifactId> <version>1.2.3.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> My main class: @SpringBootApplication //@Configuration @ComponentScan(basePackages = "com.mypackage") @EnableAutoConfiguration @EnableEurekaClient @EnableSwagger2 public class App { public static void main( String[] args ) { SpringApplication.run(App.class, args); } @LoadBalanced @Bean(name=