Java Code Examples for org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer

The following examples show how to use org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Bean
public SmartInitializingSingleton loadBalancedRestTemplateInitializer2(
        final ObjectProvider<List<RestTemplateCustomizer>> restTemplateCustomizers) {
    return () -> {
        logger.info("RestTemplateResilienceAutoConfiguration init2");
        for (RestTemplate restTemplate : RestTemplateCircuitBreakerAutoConfiguration.this.restTemplates) {
            List<ClientHttpRequestInterceptor> interceptors = restTemplate.getInterceptors();
            logger.info("RestTemplate init2 start,interceptor size:" + interceptors.size());
            //for (ClientHttpRequestInterceptor interceptor : interceptors) {
            //logger.info("RestTemplate init2 interceptor ing:"+interceptor.getClass().getCanonicalName());
            //}
            //logger.info("RestTemplate init2 Customizer end");
            ClientHttpRequestInterceptor interceptor1 = new RestTemplateCircuitBreakerInterceptor
                    (circuitBreakerCore);
            interceptors.add(0, interceptor1);
            restTemplate.setInterceptors(interceptors);
            logger.info("RestTemplate init2 end,add CircuitBreaker interceptor");
        }
    };
}
 
Example 2
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 3
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 4
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 5
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 6
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 7
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 8
Source Project: cubeai   Source File: MicroserviceSecurityConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 9
Source Project: myfeed   Source File: MyfeedAutoConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public RestTemplateCustomizer restTemplateCustomizer(final RibbonClientHttpRequestFactory requestFactory) {
    return restTemplate -> {
        restTemplate.setRequestFactory(requestFactory);
        addConverters(restTemplate);
    };
}
 
Example 10
Source Project: tutorials   Source File: SecurityConfiguration.java    License: MIT License 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 11
Source Project: tutorials   Source File: SecurityConfiguration.java    License: MIT License 5 votes vote down vote up
@Bean
@Qualifier("loadBalancedRestTemplate")
   public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
       RestTemplate restTemplate = new RestTemplate();
       customizer.customize(restTemplate);
       return restTemplate;
   }
 
Example 12
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 13
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 14
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 15
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 16
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 17
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 18
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 19
Source Project: cubeai   Source File: SecurityBeanOverrideConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 20
Source Project: myfeed   Source File: MyfeedAutoConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
   @LoadBalanced
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
	return rest(customizer);
}
 
Example 21
Source Project: tutorials   Source File: SecurityBeanOverrideConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 22
Source Project: tutorials   Source File: SecurityBeanOverrideConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}
 
Example 23
Source Project: tutorials   Source File: SecurityBeanOverrideConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
    return null;
}