1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

polish #761 update pkg name & maven coordinate for Edgware

This commit is contained in:
fangjian0423
2019-07-24 22:06:05 +08:00
parent 8e73a34e2a
commit f19c83a7a9
405 changed files with 2709 additions and 2568 deletions

View File

@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-examples</artifactId>
<version>0.1.3.BUILD-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
@@ -22,7 +22,7 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>

View File

@@ -1,9 +1,9 @@
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import org.springframework.cloud.alibaba.sentinel.rest.SentinelClientHttpResponse;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import com.alibaba.cloud.sentinel.rest.SentinelClientHttpResponse;
import com.alibaba.csp.sentinel.slots.block.BlockException;
/**

View File

@@ -1,11 +1,11 @@
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.alibaba.sentinel.annotation.SentinelRestTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
import com.alibaba.cloud.sentinel.annotation.SentinelRestTemplate;
import com.alibaba.csp.sentinel.datasource.Converter;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

View File

@@ -11,7 +11,7 @@ spring.cloud.sentinel.datasource.ds1.file.rule-type=flow
#spring.cloud.sentinel.datasource.ds1.file.file=classpath: flowrule.json
#spring.cloud.sentinel.datasource.ds1.file.data-type=custom
#spring.cloud.sentinel.datasource.ds1.file.converter-class=org.springframework.cloud.alibaba.cloud.examples.JsonFlowRuleListConverter
#spring.cloud.sentinel.datasource.ds1.file.converter-class=JsonFlowRuleListConverter
#spring.cloud.sentinel.datasource.ds1.file.rule-type=flow
spring.cloud.sentinel.datasource.ds2.file.file=classpath: degraderule.json

View File

@@ -50,7 +50,7 @@ Provider端在application.properties文件中定义dubbo相关的配置比如
foo.service.version = 1.0.0
dubbo.scan.basePackages = org.springframework.cloud.alibaba.cloud.examples
dubbo.scan.basePackages = com.alibaba.cloud.examples
dubbo.application.id = dubbo-provider-demo
dubbo.application.name = dubbo-provider-demo
@@ -66,7 +66,7 @@ Provider端在application.properties文件中定义dubbo相关的配置比如
`sentinel-dubbo-api`模块中定义了FooService服务内容如下
package org.springframework.cloud.alibaba.cloud.examples.FooService;
package com.alibaba.cloud.examples;
public interface FooService {
String hello(String name);
}
@@ -93,17 +93,17 @@ Consumer端在服务调用之前先定义限流规则。
`sentinel-dubbo-api`模块中定义了FooService服务内容如下
package org.springframework.cloud.alibaba.cloud.examples.FooService;
package com.alibaba.cloud.examples;
public interface FooService {
String hello(String name);
}
该服务在Sentinel下对应的资源名是 `org.springframework.cloud.alibaba.cloud.examples.dubbo.FooService:hello(java.lang.String)`
该服务在Sentinel下对应的资源名是 `com.alibaba.cloud.examples.FooService:hello(java.lang.String)`
定义该资源名对应的限流规则:
FlowRule flowRule = new FlowRule();
flowRule.setResource("org.springframework.cloud.alibaba.cloud.examples.dubbo.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");

View File

@@ -48,7 +48,7 @@ Define some configs of dubbo in `application.properties` in provider side, like
foo.service.version = 1.0.0
dubbo.scan.basePackages = org.springframework.cloud.alibaba.cloud.examples
dubbo.scan.basePackages = com.alibaba.cloud.examples
dubbo.application.id = dubbo-provider-demo
dubbo.application.name = dubbo-provider-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 org.springframework.cloud.alibaba.cloud.examples.FooService;
package com.alibaba.cloud.examples;
public interface FooService {
String hello(String name);
}
@@ -91,17 +91,17 @@ We will configure flow control rules before service invocation in consumer side.
`sentinel-dubbo-api` define a service named FooService:
package org.springframework.cloud.alibaba.cloud.examples.FooService;
package com.alibaba.cloud.examples;
public interface FooService {
String hello(String name);
}
The resource name of this service's `hello` method is `org.springframework.cloud.alibaba.cloud.examples.dubbo.FooService:hello(java.lang.String)` .
The resource name of this service's `hello` method is `com.alibaba.cloud.examples.FooService:hello(java.lang.String)` .
Configure rules:
FlowRule flowRule = new FlowRule();
flowRule.setResource("org.springframework.cloud.alibaba.cloud.examples.dubbo.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");

View File

@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-examples</artifactId>
<version>0.1.3.BUILD-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>

View File

@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-examples</artifactId>
<version>0.1.3.BUILD-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
@@ -18,12 +18,12 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>sentinel-dubbo-api</artifactId>
</dependency>

View File

@@ -1,4 +1,4 @@
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import java.util.Collections;
@@ -15,7 +15,7 @@ import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
/**
* @author fangjian
*/
@SpringBootApplication(scanBasePackages = "org.springframework.cloud.alibaba.cloud.examples")
@SpringBootApplication(scanBasePackages = "com.alibaba.cloud.examples")
public class SentinelDubboConsumerApp {
@Bean
@@ -26,17 +26,15 @@ public class SentinelDubboConsumerApp {
public static void main(String[] args) {
FlowRule flowRule = new FlowRule();
flowRule.setResource(
"org.springframework.cloud.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");
FlowRuleManager.loadRules(Collections.singletonList(flowRule));
SpringApplicationBuilder consumerBuilder = new SpringApplicationBuilder();
ApplicationContext applicationContext = consumerBuilder
.web(false).sources(SentinelDubboConsumerApp.class)
.run(args);
ApplicationContext applicationContext = consumerBuilder.web(false)
.sources(SentinelDubboConsumerApp.class).run(args);
FooServiceConsumer service = applicationContext.getBean(FooServiceConsumer.class);

View File

@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-examples</artifactId>
<version>0.1.3.BUILD-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
@@ -18,12 +18,12 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>sentinel-dubbo-api</artifactId>
</dependency>

View File

@@ -1,4 +1,4 @@
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -11,8 +11,7 @@ public class SentinelDubboProviderApp {
public static void main(String[] args) {
SpringApplicationBuilder providerBuilder = new SpringApplicationBuilder();
providerBuilder.web(false)
.sources(SentinelDubboProviderApp.class).run(args);
providerBuilder.web(false).sources(SentinelDubboProviderApp.class).run(args);
}
}

View File

@@ -2,7 +2,7 @@ spring.application.name = dubbo-provider-demo
foo.service.version = 1.0.0
dubbo.scan.basePackages = org.springframework.cloud.alibaba.cloud.examples
dubbo.scan.basePackages = com.alibaba.cloud.examples
dubbo.application.id = dubbo-provider-demo
dubbo.application.name = dubbo-provider-demo

View File

@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-examples</artifactId>
<version>0.1.3.BUILD-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
@@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
@@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
</dependency>

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import java.util.List;
import java.util.Set;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.cloud.alibaba.cloud.examples;
package com.alibaba.cloud.examples;
import javax.servlet.http.HttpServletRequest;