tags: springcloud spring boot nacos Configuration Center
Previous article We explain the basic preparation work, and how to integrate SpringBoot with Nacos as a registration center. Today we continue to play NACOS as a configuration center. This article is based on two articles. Subsequent, some pre-prepared work will not be more detailed, and the classmates who do not know can first view the following article content.
Java SpringCloud Series (6) - NACOS Single Edition / Cluster Edition and Precautions under Linux
Java SpringCloud Series (7) - SpringBoot2.1.x Integrated NACOS as a Register Correspondence Code Description
Step 1: Add dependence
// https://mvnrepository.com/artifact/com.alibaba.cloud/spring-cloud-starter-alibaba-nacos-config
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: '2.1.2.RELEASE'

Step 2: Add a corresponding configuration in the bootstrap.yml configuration file, the code meaning has a correspondence in the code, please read it yourself.
# ================================= Basic configuration ======================================================================================================================================================================================================= =================================================================================================================================================================================
server:
port: 7165
spring:
application:
name: beyondli-nacos-demo
# Can use this parameter to perform environmental distinguishing (file name rules for Spring.Application.name-profiles.active.file-extension)
#profiles:
# active: dev
cloud:
nacos:
discovery:
server-addr: ip:Port
config:
server-addr: ip:Port
file-extension: yaml
# Default value for default_group Use this parameter to use this parameter to distinguish (file name rules for Spring.Application.name-profiles.active.file-extension)
group: BEYONDLI_NACOS_DEV
Step 3: Enter NACOS to create a corresponding configuration file based on the code in the code

Step 4: Writing Getting Configuration Center Value Code


Step 1: Add @refreshscope on the required class

Step 2: Modify the configuration center value for testing

Step 3: Refresh the interface, return value automatic changes

All right. The above is all of our articles.
Nacos Config Center The previous article introduced the use of the configuration center in Spring Cloud, address: This section introduces the use of Nacos as a configuration center, without Github The...
Article catalog Configuring NACOS Use mysql persistence Solve the problem that I don't support mysql8.x Login problem rely Profile Posted to get configuration release Obtain Start class Cluster constr...
Learning NaCOS as the use of registration, and NACOS can also serve as a configuration center in micro-service. This article teaches you how to build a configuration center. NACOS configuration manage...
content First, SpringCloud Configuration NACOS Configuration Center 1, add configuration center dependence 2, bootstrap.yaml add configuration center configuration 3, NACOS client add configuration 4,...
Foreword In fact, EUREKA and CONFIG (or Apollo) are equivalent to previous use. This article is provided to beginners, the fastest and easiest to use NACOS. text 1. First run our NACOS service in the ...
What is nacos The full English name of Dynamic Naming and Configuration Service, NA is Naming/NameServer, as the registration center, CO is configuration, as the registration center. Service means tha...
SPINGBOOT2.X Integrated NACOS Configuration Center DEMO 1 Page configuration information add 1.1 New Naming Space 1.2 Add configuration information 2 dependencies 3 Configuration information settings ...
Steps to use mars dynamic configuration center 1. Clone the github project to the local address:https://github.com/fashionbrot/mars-config.git 2. Find the init.sql wear library mars_test...
concept Unified management of micro-service profiles Architecture diagram of the micro service integration configuration center Profile format Name: Micro Service Name Profile: En...
Nacos Server installation Please refer to Nacos installationNacos source code entry running configuration Create project Use IntelliJ IDEA to create a Spring Boot project, the version is2.2.1.RELEASE ...