Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use utf-8 properties files #48

Open
wants to merge 1 commit into
base: acm
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# \u5728\u547D\u540D\u7A7A\u95F4\u8BE6\u60C5\u5904\u53EF\u4EE5\u83B7\u53D6\u5230 endpoint \u548C namespace \u7684\u503C
# 在命名空间详情处可以获取到 endpoint namespace 的值
nacos.config.endpoint=xxx
nacos.config.namespace=xxx

# \u63A8\u8350\u4F7F\u7528 RAM \u8D26\u6237\u7684 accessKey \u548C secretKey
# 推荐使用 RAM 账户的 accessKey secretKey
nacos.config.access-key=xxx
nacos.config.secret-key=xxx

# endpoint http://localhost:8080/actuator/nacos-config
# health http://localhost:8080/actuator/health
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
management.endpoint.health.show-details=always
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# \u5728\u547D\u540D\u7A7A\u95F4\u8BE6\u60C5\u5904\u53EF\u4EE5\u83B7\u53D6\u5230 endpoint \u548C namespace \u7684\u503C
# 在命名空间详情处可以获取到 endpoint namespace 的值
spring.cloud.nacos.config.endpoint=xxx
spring.cloud.nacos.config.namespace=xxx

# \u63A8\u8350\u4F7F\u7528 RAM \u8D26\u6237\u7684 accessKey \u548C secretKey
# 推荐使用 RAM 账户的 accessKey secretKey
spring.cloud.nacos.config.access-key=xxx
spring.cloud.nacos.config.secret-key=xxx

# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A
# Data ID\uFF1Acom.alibaba.nacos.example.properties
# Group\uFF1ADEFAULT_GROUP
# \u914D\u7F6E\u5185\u5BB9\uFF1AconnectTimeoutInMills=5000
# ACM 控制台添加配置:
# Data ID:com.alibaba.nacos.example.properties
# Group:DEFAULT_GROUP
# 配置内容:connectTimeoutInMills=5000
spring.application.name=com.alibaba.nacos.example
# \u6307\u5B9A\u914D\u7F6E\u7684\u540E\u7F00\uFF0C\u652F\u6301 properties\u3001yaml\u3001yml\uFF0C\u9ED8\u8BA4\u4E3A properties
# 指定配置的后缀,支持 properties、yaml、yml,默认为 properties
spring.cloud.nacos.config.file-extension=properties
#spring.cloud.nacos.config.file-extension=yaml
#spring.cloud.nacos.config.file-extension=yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
spring.application.name=multi-data-ids-example

# \u5728\u547D\u540D\u7A7A\u95F4\u8BE6\u60C5\u5904\u53EF\u4EE5\u83B7\u53D6\u5230 endpoint \u548C namespace \u7684\u503C
# 在命名空间详情处可以获取到 endpoint namespace 的值
spring.cloud.nacos.config.endpoint=xxx
spring.cloud.nacos.config.namespace=xxx

# \u63A8\u8350\u4F7F\u7528 RAM \u8D26\u6237\u7684 accessKey \u548C secretKey
# 推荐使用 RAM 账户的 accessKey secretKey
spring.cloud.nacos.config.access-key=xxx
spring.cloud.nacos.config.secret-key=xxx

# 0.2.1.RELEASE \u4EE5\u4E0A\u652F\u6301\u591A\u4E2A\u914D\u7F6E\uFF0C\u6587\u6863\uFF1Ahttps://github.com/spring-cloud-incubator/spring-cloud-alibaba/wiki/Nacos-config
# 0.2.1.RELEASE 以上支持多个配置,文档:https://github.com/spring-cloud-incubator/spring-cloud-alibaba/wiki/Nacos-config

# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A
# Data ID\uFF1Aapp.properties
# Group\uFF1Amulti-data-ids
# \u914D\u7F6E\u5185\u5BB9\uFF1Aapp.user.cache=false
# ACM 控制台添加配置:
# Data ID:app.properties
# Group:multi-data-ids
# 配置内容:app.user.cache=false
spring.cloud.nacos.config.ext-config[0].data-id=app.properties
spring.cloud.nacos.config.ext-config[0].group=multi-data-ids
spring.cloud.nacos.config.ext-config[0].refresh=true

# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A
# Data ID\uFF1Adatasource.properties
# Group\uFF1Amulti-data-ids
# \u914D\u7F6E\u5185\u5BB9\u793A\u4F8B\uFF1A
# ACM 控制台添加配置:
# Data ID:datasource.properties
# Group:multi-data-ids
# 配置内容示例:
# spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false
# spring.datasource.username=root
# spring.datasource.password=root
Expand All @@ -30,10 +30,10 @@ spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.ext-config[1].data-id=datasource.properties
spring.cloud.nacos.config.ext-config[1].group=multi-data-ids

# ACM \u63A7\u5236\u53F0\u6DFB\u52A0\u914D\u7F6E\uFF1A
# Data ID\uFF1Aredis.properties
# Group\uFF1Amulti-data-ids
# \u914D\u7F6E\u5185\u5BB9\u793A\u4F8B\uFF1A
# ACM 控制台添加配置:
# Data ID:redis.properties
# Group:multi-data-ids
# 配置内容示例:
# spring.redis.host=localhost
# spring.redis.password=20190101
# spring.redis.timeout=5000
Expand All @@ -42,4 +42,4 @@ spring.cloud.nacos.config.ext-config[1].group=multi-data-ids
# spring.redis.max-wait=3000
# spring.redis.test-on-borrow=false
spring.cloud.nacos.config.ext-config[2].data-id=redis.properties
spring.cloud.nacos.config.ext-config[2].group=multi-data-ids
spring.cloud.nacos.config.ext-config[2].group=multi-data-ids
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
spring.application.name=service-consumer
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
server.port=18080
spring.application.name=service-provider
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
<artifactId>nacos-examples</artifactId>
<packaging>pom</packaging>
<version>0.2.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<modules>
<module>nacos-spring-example</module>
<module>nacos-spring-boot-example</module>
Expand Down