Skip to content

Commit

Permalink
正式版本发布v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
matevip committed Sep 1, 2020
1 parent c1b1aaa commit 187da98
Show file tree
Hide file tree
Showing 45 changed files with 534 additions and 343 deletions.
643 changes: 349 additions & 294 deletions doc/sql/matex_schema.sql

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mate-core/mate-starter-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-cloud/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ${AnsiColor.BLUE} | \/ |(_)_\(_)|_ _|| __|
${AnsiColor.BLUE} | |\/| | / _ \ | | | _|
${AnsiColor.BLUE} |_| |_|/_/ \_\ |_| |___|

${AnsiColor.BLUE}:: MATE:: ${spring.application.name}
${AnsiColor.BLUE}:: MATE:: ${spring.application.name} :: v1.0.1
${AnsiColor.BLUE}:: Spring-Boot: ${AnsiColor.RED}${spring-boot.version}${AnsiColor.BLUE} :: ${AnsiColor.BRIGHT_BLACK}
13 changes: 11 additions & 2 deletions mate-core/mate-starter-cloud/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ spring:
namespace: @config.namespace@
server-addr: @config.server-addr@
sentinel:
# 是否开启sentinel
enabled: true
filter:
enabled: true
# 取消Sentinel控制台懒加载
eager: true
transport:
port: @sentinel.port@
dashboard: @sentinel.dashboard@
#port: @sentinel.port@
dashboard: @sentinel.dashboard@
feign:
sentinel:
enabled: true
2 changes: 1 addition & 1 deletion mate-core/mate-starter-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MateConstant {
/**
* 应用版本号
*/
public static final String MATE_APP_VERSION = "1.0.1.RC";
public static final String MATE_APP_VERSION = "1.0.1";

/**
* Spring 应用名 prop key
Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
9 changes: 7 additions & 2 deletions mate-core/mate-starter-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

<groupId>vip.mate</groupId>
<artifactId>mate-starter-dependencies</artifactId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
<packaging>pom</packaging>
<description>MateCloud统一版本依赖</description>

<properties>
<matecloud.core.version>1.0.1.RC</matecloud.core.version>
<matecloud.core.version>1.0.1</matecloud.core.version>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>

<spring.boot.version>2.3.3.RELEASE</spring.boot.version>
Expand Down Expand Up @@ -492,6 +492,11 @@
<artifactId>sentinel-api-gateway-adapter-common</artifactId>
<version>${sentinel.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-reactor-adapter</artifactId>
<version>${sentinel.version}</version>
</dependency>


</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-dozer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-dubbo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-feign/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-file/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-gray/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-jetcache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-oss/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-rocketmq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-rule/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
3 changes: 2 additions & 1 deletion mate-core/mate-starter-sentinel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -24,6 +24,7 @@
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-nacos</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
package com.alibaba.cloud.sentinel.endpoint;

import com.alibaba.cloud.sentinel.SentinelProperties;
import com.alibaba.csp.sentinel.datasource.AbstractDataSource;
import com.alibaba.csp.sentinel.heartbeat.HeartbeatSenderProvider;
import com.alibaba.csp.sentinel.transport.HeartbeatSender;
import com.alibaba.csp.sentinel.transport.config.TransportConfig;
import com.alibaba.csp.sentinel.util.function.Tuple2;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SentinelHealthIndicator extends AbstractHealthIndicator {

private DefaultListableBeanFactory beanFactory;

private SentinelProperties sentinelProperties;

public SentinelHealthIndicator(DefaultListableBeanFactory beanFactory,
SentinelProperties sentinelProperties) {
this.beanFactory = beanFactory;
this.sentinelProperties = sentinelProperties;
}

@Override
protected void doHealthCheck(Health.Builder builder) throws Exception {
Map<String, Object> detailMap = new HashMap<>();

// If sentinel isn't enabled, set the status up and set the enabled to false in
// detail
if (!sentinelProperties.isEnabled()) {
detailMap.put("enabled", false);
builder.up().withDetails(detailMap);
return;
}

detailMap.put("enabled", true);

// Check health of Dashboard
boolean dashboardUp = true;
List<Tuple2<String, Integer>> consoleServer = TransportConfig.getConsoleServerList();
if (consoleServer == null) {
// If Dashboard isn't configured, it's OK and mark the status of Dashboard
// with UNKNOWN.
detailMap.put("dashboard",
new Status(Status.UNKNOWN.getCode(), "dashboard isn't configured"));
}
else {
// If Dashboard is configured, send a heartbeat message to it and check the
// result
HeartbeatSender heartbeatSender = HeartbeatSenderProvider
.getHeartbeatSender();
boolean result = heartbeatSender.sendHeartbeat();
if (result) {
detailMap.put("dashboard", Status.UP);
}
else {
// If failed to send heartbeat message, means that the Dashboard is DOWN
dashboardUp = false;
detailMap.put("dashboard", new Status(Status.DOWN.getCode(),
consoleServer + " can't be connected"));
}
}

// Check health of DataSource
boolean dataSourceUp = true;
Map<String, Object> dataSourceDetailMap = new HashMap<>();
detailMap.put("dataSource", dataSourceDetailMap);

// Get all DataSources and each call loadConfig to check if it's OK
// If no Exception thrown, it's OK
// Note:
// Even if the dynamic config center is down, the loadConfig() might return
// successfully
// e.g. for Nacos client, it might retrieve from the local cache)
// But in most circumstances it's okay
Map<String, AbstractDataSource> dataSourceMap = beanFactory
.getBeansOfType(AbstractDataSource.class);
for (Map.Entry<String, AbstractDataSource> dataSourceMapEntry : dataSourceMap
.entrySet()) {
String dataSourceBeanName = dataSourceMapEntry.getKey();
AbstractDataSource dataSource = dataSourceMapEntry.getValue();
try {
dataSource.loadConfig();
dataSourceDetailMap.put(dataSourceBeanName, Status.UP);
}
catch (Exception e) {
// If one DataSource failed to loadConfig, means that the DataSource is
// DOWN
dataSourceUp = false;
dataSourceDetailMap.put(dataSourceBeanName,
new Status(Status.DOWN.getCode(), e.getMessage()));
}
}

// If Dashboard and DataSource are both OK, the health status is UP
if (dashboardUp && dataSourceUp) {
builder.up().withDetails(detailMap);
}
else {
builder.down().withDetails(detailMap);
}
}

}
2 changes: 1 addition & 1 deletion mate-core/mate-starter-sharding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-sms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.0.1.RC</version>
<version>1.0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit 187da98

Please sign in to comment.