0

I have two nacos bootstrap.yml which means two nacos with different ip, I want to load one of the bootstrap.yml according to db config.

For example, if my loadVariable value from db config is A, I want to load bootstrap-a.yml. How can I do that?

Here is my purpose step:

  1. search data from db to decide load bootstrap-a.yml or bootstrap-b.yml
  2. register the service to nacos according to bootstrap config file
flower
  • 2,212
  • 3
  • 29
  • 44
  • Does this answer your question? [howto-change-configuration-depending-on-the-environment](https://docs.spring.io/spring-boot/docs/1.2.0.M1/reference/html/howto-properties-and-configuration.html#howto-change-configuration-depending-on-the-environment) – Saravanakrishnan Pk Aug 31 '21 at 13:13
  • @SaravanakrishnanPk,How can I load value from db and then use profile to load then? I have search most example,and all of them tell me to config the profile like set `spring.profiles.active`.But I want to set this to my database like mysql config table. – flower Aug 31 '21 at 17:37
  • you have a chicken and egg problem. bootstrap loads files long before database connections are made – spencergibb Aug 31 '21 at 18:28

0 Answers0