This is the 11th day of my participation in Gwen Challenge
preface
Welcome to our GitHub repository Star: github.com/bin39232820…
omg
Small six plans to open a series to share some of their usual development experience and discuss with you a best practice in our usual development process, is to sort out for your reference, and then learn together, progress together
- Small six at ordinary times the development of a small skill (public attribute design)
Today, let’s talk about how we should design the configuration of our system. You can also leave a message below the article to see a design of your company.
Nacos is the configuration center
By default, if you know a little bit about Nacos, you won’t go into details about how to build this and how to write the first Hello Word. Let’s go straight to the topic
Multi-environment configuration for Maven
We use Maven+bootstrap.yml to configure multiple environments, so let’s go ahead and see what I’m going to tell you
Maven+bootstrap. yML +Nacos to configure multiple environments
The first step
First we built nacOS
Configure profiles in our POM.xml as shown below
Let’s see what our bootstrap configuration file looks like
We use @pom.nacos.namespace@} to associate different namespaces, and then use namespaces in nacos to distinguish different environments
The end of the
Very simple a small practice, to share with you, because small six six before the general is through springboot multi-environment + Maven profiles to do multi-environment, or if you use containers, K8S inside can also do configuration this is also good. See this way behind, feel also very good, share to everyone ha. Well, to this, I am small six six three days fishing, two days drying nets.
Daily for praise
Ok, everybody, that’s all for this article, you can see people here, they are real fans.
Creation is not easy, your support and recognition, is the biggest motivation for my creation, we will see in the next article
Six pulse excalibur | article “original” if there are any errors in this blog, please give criticisms, be obliged!