Posts

Adding Cors Configuration to sping cloud gateway

 In your Spring cloud gateway project add this class import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.reactive.CorsWebFilter; import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; import org.springframework.web.util.pattern.PathPatternParser; @Configuration public class CorsConfig {          @Bean     public CorsWebFilter corsFilter() {         CorsConfiguration config = new CorsConfiguration();         config.addAllowedMethod("*");         config.addAllowedOrigin("*");         config.addAllowedHeader("*");         UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource...

Rabbitmq server is running but management console is not

The management plugin is not enabled by default, you need to run the below command to enable it rabbitmq-plugins enable rabbitmq_management    

Response Headers are not exposed to the client application -Spring boot,Spring microservices

Image
 I had this problem and I want to share its solution I have Angular application that send HTTP requests to the server and the sent process success but the response returns with no headers or at least the default minimum headers.  I need to read the token and some other information from the header. Solution: Response headers are not exposed by default. you must explicitly expose it in your spring boot application, in the WebSecurityConfigurerAdapter class Add this bean to your web security @Bean     public CorsFilter corsFilter() {         final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();         final CorsConfiguration config = new CorsConfiguration();         config.setAllowCredentials(true);                config.addAllowedOrigin("*");         conf...