mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge branch 'master' of github.com:alibaba/spring-cloud-alibaba into rocketmq
This commit is contained in:
commit
09841f6616
@ -70,7 +70,7 @@ Spring Cloud 使用 Maven 来构建,最快的使用方式是将本项目 clone
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
<version>2.2.4.RELEASE</version>
|
<version>2.2.5.RELEASE</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -27,6 +27,7 @@ With Spring Cloud Alibaba, you only need to add some annotations and a small amo
|
|||||||
|
|
||||||
For more features, please refer to [Roadmap](https://github.com/alibaba/spring-cloud-alibaba/blob/master/Roadmap.md).
|
For more features, please refer to [Roadmap](https://github.com/alibaba/spring-cloud-alibaba/blob/master/Roadmap.md).
|
||||||
|
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
**[Sentinel](https://github.com/alibaba/Sentinel)**: Sentinel takes "traffic flow" as the breakthrough point, and provides solutions in areas such as flow control, concurrency, circuit breaking, and load protection to protect service stability.
|
**[Sentinel](https://github.com/alibaba/Sentinel)**: Sentinel takes "traffic flow" as the breakthrough point, and provides solutions in areas such as flow control, concurrency, circuit breaking, and load protection to protect service stability.
|
||||||
@ -71,7 +72,7 @@ These artifacts are available from Maven Central and Spring Release repository v
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
<version>2.2.4.RELEASE</version>
|
<version>2.2.5.RELEASE</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
101
pom.xml
101
pom.xml
@ -80,18 +80,10 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Project revision -->
|
<!-- Project revision -->
|
||||||
<revision>2.2.5.RC2</revision>
|
<revision>2.2.6-SNAPSHOT</revision>
|
||||||
|
|
||||||
<!-- Dependency Versions -->
|
<!-- Spring Cloud -->
|
||||||
<spring-cloud-commons.version>2.2.5.RELEASE</spring-cloud-commons.version>
|
<spring.cloud.version>Hoxton.SR9</spring.cloud.version>
|
||||||
<spring-cloud-netflix.version>2.2.5.RELEASE</spring-cloud-netflix.version>
|
|
||||||
<spring-cloud-openfeign.version>2.2.5.RELEASE</spring-cloud-openfeign.version>
|
|
||||||
<spring-cloud-bus.version>2.2.3.RELEASE</spring-cloud-bus.version>
|
|
||||||
<spring-cloud-gateway.version>2.2.5.RELEASE</spring-cloud-gateway.version>
|
|
||||||
<spring-cloud-stream.version>Horsham.SR3</spring-cloud-stream.version>
|
|
||||||
<spring-cloud-consul.version>2.2.4.RELEASE</spring-cloud-consul.version>
|
|
||||||
<spring-cloud-config.version>2.2.5.RELEASE</spring-cloud-config.version>
|
|
||||||
<spring-cloud-zookeeper.version>2.2.3.RELEASE</spring-cloud-zookeeper.version>
|
|
||||||
|
|
||||||
<!-- Apache Dubbo -->
|
<!-- Apache Dubbo -->
|
||||||
<dubbo.version>2.7.8</dubbo.version>
|
<dubbo.version>2.7.8</dubbo.version>
|
||||||
@ -133,6 +125,14 @@
|
|||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>${spring.cloud.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
@ -141,85 +141,6 @@
|
|||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-commons-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-commons.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-test-support</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
<version>${spring-cloud-commons.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-netflix-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-netflix.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-openfeign-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-openfeign.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-config-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-config.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-bus-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-bus.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-gateway-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-gateway.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-stream-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-stream.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-consul-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-zookeeper-dependencies</artifactId>
|
|
||||||
<version>${spring-cloud-zookeeper.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Dubbo Dependencies -->
|
<!-- Dubbo Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.dubbo</groupId>
|
<groupId>org.apache.dubbo</groupId>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<description>Spring Cloud Alibaba Dependencies</description>
|
<description>Spring Cloud Alibaba Dependencies</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>2.2.5.RC2</revision>
|
<revision>2.2.6-SNAPSHOT</revision>
|
||||||
<sentinel.version>1.8.0</sentinel.version>
|
<sentinel.version>1.8.0</sentinel.version>
|
||||||
<seata.version>1.3.0</seata.version>
|
<seata.version>1.3.0</seata.version>
|
||||||
<nacos.client.version>1.4.1</nacos.client.version>
|
<nacos.client.version>1.4.1</nacos.client.version>
|
||||||
|
@ -72,7 +72,7 @@ Before we start the demo, let's learn how to connect Nacos Config to a Spring Cl
|
|||||||
|
|
||||||
#### Query Service
|
#### Query Service
|
||||||
|
|
||||||
Enter `http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=service-provider` in the browser address bar and click Go to, we can see that the service node has been successfully registered to Nacos Server.
|
Enter `http://127.0.0.1:8848/nacos/#/serviceDetail?name=service-provider&groupName=DEFAULT_GROUP` in the browser address bar and click Go to, we can see that the service node has been successfully registered to Nacos Server.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ spring.cloud.stream.bindings.input.group=test-group
|
|||||||
|
|
||||||
You should startup Name Server and Broker before using RocketMQ Binder.
|
You should startup Name Server and Broker before using RocketMQ Binder.
|
||||||
|
|
||||||
1. Download [RocketMQ](https://www.apache.org/dyn/closer.cgi?path=rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip) and unzip it.
|
1. Download [RocketMQ](https://archive.apache.org/dist/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip) and unzip it.
|
||||||
|
|
||||||
2. Startup Name Server
|
2. Startup Name Server
|
||||||
|
|
||||||
|
@ -99,7 +99,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -90,7 +90,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- REST support dependencies -->
|
<!-- REST support dependencies -->
|
||||||
|
@ -89,7 +89,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -51,12 +51,6 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-test-support</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
|
@ -85,12 +85,6 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-test-support</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.powermock.modules.test.powermockito/powermock-modules-test-powermockito -->
|
<!-- https://mvnrepository.com/artifact/org.powermock.modules.test.powermockito/powermock-modules-test-powermockito -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.powermock</groupId>
|
<groupId>org.powermock</groupId>
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.alibaba.cloud.nacos.logging;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.client.logging.NacosLogging;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
import org.springframework.context.event.GenericApplicationListener;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
|
import org.springframework.core.ResolvableType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reload nacos log configuration file, after
|
||||||
|
* {@link org.springframework.boot.context.logging.LoggingApplicationListener}.
|
||||||
|
*
|
||||||
|
* @author mai.jh
|
||||||
|
*/
|
||||||
|
public class NacosLoggingListener implements GenericApplicationListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsEventType(ResolvableType resolvableType) {
|
||||||
|
Class<?> type = resolvableType.getRawClass();
|
||||||
|
if (type != null) {
|
||||||
|
return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(type);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onApplicationEvent(ApplicationEvent applicationEvent) {
|
||||||
|
NacosLogging.getInstance().loadConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOrder() {
|
||||||
|
return Ordered.HIGHEST_PRECEDENCE + 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -8,3 +8,5 @@ com.alibaba.cloud.nacos.diagnostics.analyzer.NacosConnectionFailureAnalyzer
|
|||||||
org.springframework.boot.env.PropertySourceLoader=\
|
org.springframework.boot.env.PropertySourceLoader=\
|
||||||
com.alibaba.cloud.nacos.parser.NacosJsonPropertySourceLoader,\
|
com.alibaba.cloud.nacos.parser.NacosJsonPropertySourceLoader,\
|
||||||
com.alibaba.cloud.nacos.parser.NacosXmlPropertySourceLoader
|
com.alibaba.cloud.nacos.parser.NacosXmlPropertySourceLoader
|
||||||
|
org.springframework.context.ApplicationListener=\
|
||||||
|
com.alibaba.cloud.nacos.logging.NacosLoggingListener
|
@ -111,12 +111,6 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-test-support</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.projectreactor</groupId>
|
<groupId>io.projectreactor</groupId>
|
||||||
<artifactId>reactor-test</artifactId>
|
<artifactId>reactor-test</artifactId>
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.alibaba.cloud.nacos.discovery.logging;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.client.logging.NacosLogging;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
import org.springframework.context.event.GenericApplicationListener;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
|
import org.springframework.core.ResolvableType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reload nacos log configuration file, after
|
||||||
|
* {@link org.springframework.boot.context.logging.LoggingApplicationListener}.
|
||||||
|
*
|
||||||
|
* @author mai.jh
|
||||||
|
*/
|
||||||
|
public class NacosLoggingListener implements GenericApplicationListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsEventType(ResolvableType resolvableType) {
|
||||||
|
Class<?> type = resolvableType.getRawClass();
|
||||||
|
if (type != null) {
|
||||||
|
return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(type);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onApplicationEvent(ApplicationEvent applicationEvent) {
|
||||||
|
NacosLogging.getInstance().loadConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOrder() {
|
||||||
|
return Ordered.HIGHEST_PRECEDENCE + 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -9,3 +9,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
|||||||
com.alibaba.cloud.nacos.NacosServiceAutoConfiguration
|
com.alibaba.cloud.nacos.NacosServiceAutoConfiguration
|
||||||
org.springframework.cloud.bootstrap.BootstrapConfiguration=\
|
org.springframework.cloud.bootstrap.BootstrapConfiguration=\
|
||||||
com.alibaba.cloud.nacos.discovery.configclient.NacosDiscoveryClientConfigServiceBootstrapConfiguration
|
com.alibaba.cloud.nacos.discovery.configclient.NacosDiscoveryClientConfigServiceBootstrapConfiguration
|
||||||
|
org.springframework.context.ApplicationListener=\
|
||||||
|
com.alibaba.cloud.nacos.discovery.logging.NacosLoggingListener
|
||||||
|
@ -78,7 +78,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
||||||
<version>${spring-cloud-zookeeper.version}</version>
|
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@ -112,7 +111,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user