0

I want to override property defined in bootstrap.yml right after it is loaded.

eg: need to override/define spring.cloud.vault.secret-id based on some condition. How I can achieve same before spring-cloud-vault use secret-id property to connect to vault server.

Thanks in advance for help.

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • You can add an application listener and once the application context is loaded you can check your condition and replace the value in Environment class – barbakini Sep 04 '17 at 09:28
  • by that time, spring-cloud-config already hit vault server to fetch secrets. So this approach is not working. I tried implementing "ApplicationListener" that is getting triggered before hitting vault server but implementation is not using properties set in my code and picking one defined in bootstrap.yml. – Neeraj Kukreti Sep 04 '17 at 10:19

0 Answers0