springboot全局常量,Spring Boot项目中的全局变量和应用程序变量定义

本文探讨了在Spring Boot微服务架构中如何管理全局变量和应用变量。通过使用Spring Cloud Config Server实现外部化配置,可以将配置存储在Git链接或本地文件系统中,并根据不同的环境配置文件。在Config Server中,创建不同环境的配置文件,如dev、test、prod,然后在客户端应用中设置指向Config Server的URI,以便按需加载不同环境的配置。
摘要由CSDN通过智能技术生成

I am trying to develop micro service by using spring and spring boot. In my project , I am converting monolithic to service oriented architecture. Project contain 20 Micro services.I these I need to set application variables and global variables. I have confusions related to this , And I am adding those confusions here,

Is possible to declare my global variables in application.properties file? If not possible where I can define my global variables?

If I am using spring config server for global configuration, How I can import those properties conditionally to client project?

Can I set different property files for different profiles in config server , and conditionally import into client project for different profiles? Here each profile representing different regions in my case.

解决方案

After My Exploration I find out Solution for this problem for loading global vari

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值