Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What is the best way to expose custom application configuration with Spring Boot?

Pragya Keshap answered on February 23, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • database configuration spring boot
  • spring boot application properties port
  • application properties spring boot
  • configure port for spring boot
  • spring boot configure server port (application.yml)
  • appconfig spring
  • configure port for spring boot
  • How do you create an application context with Spring?
  • configurationproperties in spring boot
  • What are the different ways to create a Spring boot application?
  • What is the way to use profiles to configure the environment-specific configuration with Spring Boot?
  • configurationproperties in spring boot
  • Add a spring.config.import=configserver: property to your configuration.
  • How does a spring boot application get started?
  • Configure Spring Boot Actuator for development usage
  • What are the steps to deploy Spring Boot web applications as JAR and WAR files?
  • spring application configuration example
  • How can you add custom application properties using Spring Boot?
  • How to create a Spring Boot application using Spring Initializer?
  • Where can you define properties in Spring Boot application?
  • Which Is Better to Configure a Spring Boot Project — Properties or YAML?
  • configurationproperties in spring boot
  • What are Different Ways of Running Spring Boot Application?
  • How many types of projects we can create using Spring boot?
  • Spring Boot - @SpringApplicationConfiguration example
  • Can you name some common Spring Boot Starter POMs?
  • set profiles using Maven in Spring Boot
  • Where would you typically find a maven Spring Boot configuration file?
  • What is the process that you need to follow to run Spring Boot application on the custom port?
  • Can you use Spring Boot with applications which are not using Spring?

  • What is the best way to expose custom application configuration with Spring Boot?

    0

    One way to expose the custom application configuration in Spring Boot is by using the @Value annotation. But, the only problem with this annotation is that all the configuration values will be distributed throughout the application. Instead, you can use a centralized approach.

    By centralized approach, I mean that you can define a configuration component using the @ConfigurationProperties as follows: 

    https://docs.spring.io/spring-boot/docs/2.1.13.RELEASE/reference/html/boot-features-external-config.html

    Popularity 1/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 23 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.