mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge code from upstream
This commit is contained in:
@@ -66,7 +66,7 @@ Provider端在application.properties文件中定义dubbo相关的配置,比如
|
||||
|
||||
`sentinel-dubbo-api`模块中定义了FooService服务,内容如下:
|
||||
|
||||
package com.alibaba.cloud.examples.FooService;
|
||||
package FooService;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ Consumer端在服务调用之前,先定义限流规则。
|
||||
|
||||
`sentinel-dubbo-api`模块中定义了FooService服务,内容如下:
|
||||
|
||||
package com.alibaba.cloud.examples.FooService;
|
||||
package FooService;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ Before we start the demo, let's learn how to connect Sentinel with Dubbo to a Sp
|
||||
1. Add dependency spring-cloud-starter-alibaba-sentinel and dubbo-spring-boot-starter in the pom.xml file in your Spring Cloud project.
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
@@ -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 com.alibaba.cloud.examples.FooService;
|
||||
package FooService;
|
||||
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 com.alibaba.cloud.examples.FooService;
|
||||
package FooService;
|
||||
public interface FooService {
|
||||
String hello(String name);
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>sentinel-dubbo-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>api for sentinel dubbo example</description>
|
||||
|
@@ -5,6 +5,6 @@ package com.alibaba.cloud.examples;
|
||||
*/
|
||||
public interface FooService {
|
||||
|
||||
String hello(String name);
|
||||
String hello(String name);
|
||||
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>alibaba-sentinel-spring-cloud-starter</artifactId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@@ -27,8 +27,7 @@ public class SentinelDubboConsumerApp {
|
||||
public static void main(String[] args) {
|
||||
|
||||
FlowRule flowRule = new FlowRule();
|
||||
flowRule.setResource(
|
||||
"com.alibaba.cloud.examples.FooService:hello(java.lang.String)");
|
||||
flowRule.setResource("com.alibaba.cloud.examples.FooService:hello(java.lang.String)");
|
||||
flowRule.setCount(10);
|
||||
flowRule.setGrade(RuleConstant.FLOW_GRADE_QPS);
|
||||
flowRule.setLimitApp("default");
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>alibaba-sentinel-spring-cloud-starter</artifactId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
Reference in New Issue
Block a user