mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
sync & commit in finchley
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
|
||||
[Sentinel](https://github.com/alibaba/Sentinel) 是阿里巴巴开源的分布式系统的流量防卫组件,Sentinel 把流量作为切入点,从流量控制,熔断降级,系统负载保护等多个维度保护服务的稳定性。
|
||||
|
||||
[Dubbo](http://dubbo.apache.org/)是一款高性能Java RPC框架,有对应的[SpringBoot工程](https://github.com/apache/incubator-dubbo-spring-boot-project)。
|
||||
[Dubbo](http://dubbo.apache.org/)是一款高性能Java RPC框架,有对应的[SpringBoot工程](https://github.com/apache/dubbo-spring-boot-project)。
|
||||
|
||||
本项目专注于Sentinel与Dubbo的整合,关于Sentinel的更多特性可以查看[sentinel-core-example](https://github.com/spring-cloud-incubator/spring-cloud-alibaba/tree/master/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example)。
|
||||
本项目专注于Sentinel与Dubbo的整合,关于Sentinel的更多特性可以查看[sentinel-core-example](https://github.com/alibaba/spring-cloud-alibaba/tree/master/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example)。
|
||||
|
||||
## 示例
|
||||
|
||||
@@ -66,7 +66,7 @@ Provider端在application.properties文件中定义dubbo相关的配置,比如
|
||||
|
||||
`sentinel-dubbo-api`模块中定义了FooService服务,内容如下:
|
||||
|
||||
package FooService;
|
||||
package com.alibaba.cloud.examples;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ Consumer端在服务调用之前,先定义限流规则。
|
||||
|
||||
`sentinel-dubbo-api`模块中定义了FooService服务,内容如下:
|
||||
|
||||
package FooService;
|
||||
package com.alibaba.cloud.examples;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ This example illustrates how to use Sentinel starter to implement flow control f
|
||||
|
||||
[Dubbo](http://dubbo.apache.org/) is a high-performance, java based open source RPC framework.
|
||||
|
||||
This example focus on the integration of Sentinel and Dubbo. You can see more features on [sentinel-core-example](https://github.com/spring-cloud-incubator/spring-cloud-alibaba/tree/master/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example).
|
||||
This example focus on the integration of Sentinel and Dubbo. You can see more features on [sentinel-core-example](https://github.com/alibaba/spring-cloud-alibaba/tree/master/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example).
|
||||
|
||||
## Demo
|
||||
|
||||
@@ -64,7 +64,7 @@ Define some configs of dubbo in `application.properties` in provider side, like
|
||||
|
||||
`sentinel-dubbo-api` define a service named FooService:
|
||||
|
||||
package FooService;
|
||||
package com.alibaba.cloud.examples;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ We will configure flow control rules before service invocation in consumer side.
|
||||
|
||||
`sentinel-dubbo-api` define a service named FooService:
|
||||
|
||||
package FooService;
|
||||
package com.alibaba.cloud.examples;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>sentinel-dubbo-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -2,17 +2,17 @@ package com.alibaba.cloud.examples;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.alibaba.csp.sentinel.slots.block.RuleConstant;
|
||||
import com.alibaba.csp.sentinel.slots.block.SentinelRpcException;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
|
||||
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import com.alibaba.csp.sentinel.slots.block.RuleConstant;
|
||||
import com.alibaba.csp.sentinel.slots.block.SentinelRpcException;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
|
||||
|
||||
/**
|
||||
* @author fangjian
|
||||
*/
|
||||
|
@@ -25,6 +25,7 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>sentinel-dubbo-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
Reference in New Issue
Block a user