Spring Boot: Common Properties and Default Value


Spring Boot comes with lots of default configuration that’s already defined in its application.propertie internal file. When we use spring-boot-starter-parent that’s add all these spring boot default properties in your application.

If your business required change on these default values then you can override it by writing in your application.properties/application.yaml file. On-time on initialization for application properties spring boot will override these default values with your mentioned configuration.

In the previous example, we are using the default spring boot embedded tomcat server port as 8080. It means when we launch our spring boot application embedded server will start on port 8080. Now for changing the embedded tomcat server port add this below property in your application.properties file.


server.port=8090

Now run this spring boot application example, because now embedded tomcat server is running on port 8090 so calling your application services now you have to use port 8090 instead of 8080.

Spring Boot Common properties with Default Value

For better understanding, I have categorized list of Spring Boot common properties in different categories so that you can focus as per your need.

Note: In your application, You don’t need to add all these values in your application.proprties/application.yaml file. You just need to add only those values which you want to change/override.

References

https://docs.spring.io/spring-boot/docs/1.4.x/reference/html/common-application-properties.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s