com.alibaba.csp.sentinel.adapter.gateway.sc.exception.SentinelGatewayBlockExceptionHandler Java Examples

The following examples show how to use com.alibaba.csp.sentinel.adapter.gateway.sc.exception.SentinelGatewayBlockExceptionHandler. 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
Source File: SentinelSCGAutoConfiguration.java    From spring-cloud-alibaba with Apache License 2.0 5 votes vote down vote up
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
@ConditionalOnMissingBean
public SentinelGatewayBlockExceptionHandler sentinelGatewayBlockExceptionHandler() {
	// Register the block exception handler for Spring Cloud Gateway.
	logger.info(
			"[Sentinel SpringCloudGateway] register SentinelGatewayBlockExceptionHandler");
	return new SentinelGatewayBlockExceptionHandler(viewResolvers,
			serverCodecConfigurer);
}
 
Example #2
Source File: GatewayConfiguration.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 4 votes vote down vote up
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
public SentinelGatewayBlockExceptionHandler sentinelGatewayBlockExceptionHandler() {
    // Register the block exception handler for Spring Cloud Gateway.
    return new SentinelGatewayBlockExceptionHandler(viewResolvers, serverCodecConfigurer);
}
 
Example #3
Source File: GatewayConfiguration.java    From spring-cloud-sofastack-samples with Apache License 2.0 4 votes vote down vote up
/**
 * 配置SentinelGatewayBlockExceptionHandler,限流后异常处理
 * @return
 */
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
public SentinelGatewayBlockExceptionHandler sentinelGatewayBlockExceptionHandler() {
    return new SentinelGatewayBlockExceptionHandler(viewResolvers, serverCodecConfigurer);
}
 
Example #4
Source File: GatewayConfiguration.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
public SentinelGatewayBlockExceptionHandler sentinelGatewayBlockExceptionHandler() {
    // Register the block exception handler for Spring Cloud Gateway.
    return new SentinelGatewayBlockExceptionHandler(viewResolvers, serverCodecConfigurer);
}