mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
以2.2.1.BUILD-SNAPSHOT 为基准,适配Greenwich版本的Spring Cloud
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.alibaba.cloud.examples;
|
||||
|
||||
import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.BlockRequestHandler;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -40,8 +39,7 @@ public class MySCGConfiguration {
|
||||
@Override
|
||||
public Mono<ServerResponse> handleRequest(ServerWebExchange exchange,
|
||||
Throwable t) {
|
||||
return ServerResponse.status(444)
|
||||
.contentType(MediaType.APPLICATION_JSON_UTF8)
|
||||
return ServerResponse.status(444).contentType(MediaType.APPLICATION_JSON)
|
||||
.body(fromObject("SCS Sentinel block"));
|
||||
}
|
||||
};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,7 +25,6 @@ import com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayFlowRule;
|
||||
import com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@@ -31,8 +31,8 @@ spring:
|
||||
ruleType: gw-api-group
|
||||
transport:
|
||||
dashboard: localhost:8080
|
||||
# filter:
|
||||
# enabled: true
|
||||
filter:
|
||||
enabled: true
|
||||
scg.fallback:
|
||||
mode: response
|
||||
response-status: 444
|
||||
|
Reference in New Issue
Block a user