Skip to content

Commit

Permalink
Merge pull request #4 from alibaba/master
Browse files Browse the repository at this point in the history
Sync the newest code
  • Loading branch information
jifengnan authored Mar 12, 2019
2 parents abbdbab + 2b9d884 commit 05c3881
Show file tree
Hide file tree
Showing 158 changed files with 2,692 additions and 8,220 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Here is for bug reports and feature requests ONLY!
If you're looking for help, please check our mail list、WeChat group and the Gitter room.
Please try to use English to describe your issue, or at least provide a snippet of English translation.
我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。
-->

## Issue Description

Type: *bug report* or *feature request*

### Describe what happened (or what feature you want)


### Describe what you expected to happen


### How to reproduce it (as minimally and precisely as possible)

1.
2.
3.

### Tell us your environment


### Anything else we need to know?
43 changes: 0 additions & 43 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.9.0(Feb 28, 2019)

* [#840] Nacos server adds startup mode to distinguish between config and naming.
* [#762] Register instance returns failed when the health check mode is 'server' in standalone mode.
* [#473] Nacos Cluster Mode kubernate Startup nacos.log error Log.
* [#240] Log strong dependence problem.
* [#824] getServicesOfServer throws exception if service list is empty.
* [#802] Nacos server multi-boot mode support.
* [#800] Nacos's client-to-server addressing mode document introduction.
* [#768] The interval at which the heartbeat is sent in BeatReactor is not controlled by the server return value.
* [#759] why instance can't auto-delete.
* [#756] Format of instance and service should be validated.
* [#720] Memory leak in PushService.
* [#653] IoUtils under nacos-common-0.2.1-RC1.jar lacks "" judgment on encoding.
* [#588] Client compatible to jdk1.6.

## 0.8.0(Jan 22, 2019) PRE-GA

* [#162] Support open metrics and prometheus
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ It is super easy to get started with your first project.

You can download the package from the [latest stable release](https://github.com/alibaba/nacos/releases).

Take release nacos-server-0.8.0.zip for example.
Take release nacos-server-0.9.0.zip for example.
```
unzip nacos-server-0.8.0.zip
unzip nacos-server-0.9.0.zip
cd nacos/bin
```

Expand Down Expand Up @@ -120,7 +120,7 @@ These are only part of the companies using Nacos, for reference only. If you are
![美菜](https://www.meicai.cn/assets/images/new-img/logo.png)
![松格科技](http://songe.so/images/logo.gif)
![平行云](https://img.alicdn.com/tfs/TB1OigyDyLaK1RjSZFxXXamPFXa-168-70.png)
![甘肃紫光](http://www.gsunis.net/V2/image/logo.jpg)
![甘肃紫光](https://img.alicdn.com/tfs/TB1gJ4vIhTpK1RjSZR0XXbEwXXa-462-60.jpg)
![海云天](http://www.seaskylight.com/cn/uploadfiles/image/logo.png)
![集萃智能](http://www.iimt.org.cn/pic/logosy.png)
![Acmedcare+](https://img.alicdn.com/tfs/TB1DZWSEzDpK1RjSZFrXXa78VXa-240-62.png)
Expand All @@ -144,6 +144,7 @@ These are only part of the companies using Nacos, for reference only. If you are
![知氏教育](https://www.chyeth.com/622e88980a5d091eaa6449f82d48ca43.png)
![中化信息](http://www.sinochem.com/Portals/0/xinlogo.png)
![海格管家](https://img.alicdn.com/tfs/TB1FNq4EwHqK1RjSZFgXXa7JXXa-232-232.jpg)
![Nepxion](https://avatars0.githubusercontent.com/u/16344119?s=200&v=4)
![东莞最佳拍档](https://img.alicdn.com/tfs/TB11ugsDzTpK1RjSZKPXXa3UpXa-300-300.png)
![chigua](https://img.alicdn.com/tfs/TB1aUe5EpzqK1RjSZSgXXcpAVXa-248-124.png)
![宅无限](https://img.alicdn.com/tfs/TB1H9O5EAvoK1RjSZFNXXcxMVXa-221-221.jpg)
Expand Down
6 changes: 3 additions & 3 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -32,8 +32,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
<source>6</source>
<target>6</target>
</configuration>
</plugin>
</plugins>
Expand Down
20 changes: 16 additions & 4 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -43,7 +43,6 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
<optional>true</optional>
</dependency>

Expand Down Expand Up @@ -108,9 +107,22 @@
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.5.0</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>6</source>
<target>6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
import com.alibaba.nacos.client.config.impl.HttpSimpleClient.HttpResult;
import com.alibaba.nacos.client.config.impl.LocalConfigInfoProcessor;
import com.alibaba.nacos.client.config.utils.ContentUtils;
import com.alibaba.nacos.client.config.utils.LogUtils;
import com.alibaba.nacos.client.config.utils.ParamUtils;
import com.alibaba.nacos.client.config.utils.TenantUtil;
import com.alibaba.nacos.client.logger.Logger;
import com.alibaba.nacos.client.logger.support.LoggerHelper;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.StringUtils;
import org.slf4j.Logger;

import java.io.IOException;
import java.net.HttpURLConnection;
Expand All @@ -52,8 +51,9 @@
@SuppressWarnings("PMD.ServiceOrDaoClassShouldEndWithImplRule")
public class NacosConfigService implements ConfigService {

final static public Logger log = LogUtils.logger(NacosConfigService.class);
public final long POST_TIMEOUT = 3000L;
private static final Logger LOGGER = LogUtils.logger(NacosConfigService.class);

private final long POST_TIMEOUT = 3000L;
/**
* http agent
*/
Expand Down Expand Up @@ -123,8 +123,8 @@ private String getConfigInner(String tenant, String dataId, String group, long t
// 优先使用本地配置
String content = LocalConfigInfoProcessor.getFailover(agent.getName(), dataId, group, tenant);
if (content != null) {
log.warn(agent.getName(), "[get-config] get failover ok, dataId={}, group={}, tenant={}, config={}", dataId,
group, tenant, ContentUtils.truncateContent(content));
LOGGER.warn("[{}] [get-config] get failover ok, dataId={}, group={}, tenant={}, config={}", agent.getName(),
dataId, group, tenant, ContentUtils.truncateContent(content));
cr.setContent(content);
configFilterChainManager.doFilter(null, cr);
content = cr.getContent();
Expand All @@ -143,14 +143,12 @@ private String getConfigInner(String tenant, String dataId, String group, long t
if (NacosException.NO_RIGHT == ioe.getErrCode()) {
throw ioe;
}
log.warn("NACOS-0003",
LoggerHelper.getErrorCodeStr("NACOS", "NACOS-0003", "环境问题", "get from server error"));
log.warn(agent.getName(), "[get-config] get from server error, dataId={}, group={}, tenant={}, msg={}",
dataId, group, tenant, ioe.toString());
LOGGER.warn("[{}] [get-config] get from server error, dataId={}, group={}, tenant={}, msg={}",
agent.getName(), dataId, group, tenant, ioe.toString());
}

log.warn(agent.getName(), "[get-config] get snapshot ok, dataId={}, group={}, tenant={}, config={}", dataId,
group, tenant, ContentUtils.truncateContent(content));
LOGGER.warn("[{}] [get-config] get snapshot ok, dataId={}, group={}, tenant={}, config={}", agent.getName(),
dataId, group, tenant, ContentUtils.truncateContent(content));
content = LocalConfigInfoProcessor.getSnapshot(agent.getName(), dataId, group, tenant);
cr.setContent(content);
configFilterChainManager.doFilter(null, cr);
Expand Down Expand Up @@ -183,20 +181,20 @@ private boolean removeConfigInner(String tenant, String dataId, String group, St
try {
result = agent.httpDelete(url, null, params, encode, POST_TIMEOUT);
} catch (IOException ioe) {
log.warn("[remove] error, " + dataId + ", " + group + ", " + tenant + ", msg: " + ioe.toString());
LOGGER.warn("[remove] error, " + dataId + ", " + group + ", " + tenant + ", msg: " + ioe.toString());
return false;
}

if (HttpURLConnection.HTTP_OK == result.code) {
log.info(agent.getName(), "[remove] ok, dataId={}, group={}, tenant={}", dataId, group, tenant);
LOGGER.info("[{}] [remove] ok, dataId={}, group={}, tenant={}", agent.getName(), dataId, group, tenant);
return true;
} else if (HttpURLConnection.HTTP_FORBIDDEN == result.code) {
log.warn(agent.getName(), "[remove] error, dataId={}, group={}, tenant={}, code={}, msg={}", dataId, group,
tenant, result.code, result.content);
LOGGER.warn("[{}] [remove] error, dataId={}, group={}, tenant={}, code={}, msg={}", agent.getName(), dataId,
group, tenant, result.code, result.content);
throw new NacosException(result.code, result.content);
} else {
log.warn(agent.getName(), "[remove] error, dataId={}, group={}, tenant={}, code={}, msg={}", dataId, group,
tenant, result.code, result.content);
LOGGER.warn("[{}] [remove] error, dataId={}, group={}, tenant={}, code={}, msg={}", agent.getName(), dataId,
group, tenant, result.code, result.content);
return false;
}
}
Expand Down Expand Up @@ -245,24 +243,22 @@ private boolean publishConfigInner(String tenant, String dataId, String group, S
try {
result = agent.httpPost(url, headers, params, encode, POST_TIMEOUT);
} catch (IOException ioe) {
log.warn("NACOS-0006",
LoggerHelper.getErrorCodeStr("NACOS", "NACOS-0006", "环境问题", "[publish-single] exception"));
log.warn(agent.getName(), "[publish-single] exception, dataId={}, group={}, msg={}", dataId, group,
ioe.toString());
LOGGER.warn("[{}] [publish-single] exception, dataId={}, group={}, msg={}", agent.getName(), dataId,
group, ioe.toString());
return false;
}

if (HttpURLConnection.HTTP_OK == result.code) {
log.info(agent.getName(), "[publish-single] ok, dataId={}, group={}, tenant={}, config={}", dataId, group,
tenant, ContentUtils.truncateContent(content));
LOGGER.info("[{}] [publish-single] ok, dataId={}, group={}, tenant={}, config={}", agent.getName(), dataId,
group, tenant, ContentUtils.truncateContent(content));
return true;
} else if (HttpURLConnection.HTTP_FORBIDDEN == result.code) {
log.warn(agent.getName(), "[publish-single] error, dataId={}, group={}, tenant={}, code={}, msg={}", dataId,
group, tenant, result.code, result.content);
LOGGER.warn("[{}] [publish-single] error, dataId={}, group={}, tenant={}, code={}, msg={}", agent.getName(),
dataId, group, tenant, result.code, result.content);
throw new NacosException(result.code, result.content);
} else {
log.warn(agent.getName(), "[publish-single] error, dataId={}, group={}, tenant={}, code={}, msg={}", dataId,
group, tenant, result.code, result.content);
LOGGER.warn("[{}] [publish-single] error, dataId={}, group={}, tenant={}, code={}, msg={}", agent.getName(),
dataId, group, tenant, result.code, result.content);
return false;
}

Expand Down
Loading

0 comments on commit 05c3881

Please sign in to comment.