{"id":23172,"date":"2015-07-23T00:27:37","date_gmt":"2015-07-22T18:57:37","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=23172"},"modified":"2016-08-26T17:29:19","modified_gmt":"2016-08-26T11:59:19","slug":"binding-external-configuration-properties-in-spring-boot-application","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/","title":{"rendered":"Binding External Configuration properties in spring boot application"},"content":{"rendered":"<p>Hi,<\/p>\n<p>In this blog\u00a0we&#8217;ll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties.<\/p>\n<p><strong>There are two ways to inject our configuration properties<\/strong>:-<\/p>\n<p>1. By Using @Value annotation (<strong>Spring 3.0+ And Grails 3.0<\/strong>)<br \/>\n2. Typesafe Configuration Properties (<strong>Sring-Boot<\/strong>)<\/p>\n<p>Lets suppoese we have a yaml(application.yml) as configuration file, i.e., the following YAML document:<\/p>\n<pre>es:\r\n  hosts: ['5.9.154.115']\r\n  port: 10600\r\n  cluster : 'elasticsearch'\r\n<\/pre>\n<p>We can also use the properties file(application.properties) for external configuration, the properties file version for the above yml file would be:-<\/p>\n<pre>es.hosts[0]='5.9.154.115'\r\nes.port=10600\r\nes.cluster='elasticsearch'\r\n<\/pre>\n<p>1. Using <b>@Value<\/b> annotation we can inject the configuration properties into our application. Syntax would be <b>@Value(#{property_name}<\/b>).<\/p>\n<p>For example, the following class represent binding the external configuration in a class using the @value annotation :-<\/p>\n<p>[code]<br \/>\n@Configuration<br \/>\npublic class SpringConfig {<br \/>\n    static Client esClient<\/p>\n<p>    @Value(&quot;#{es.hosts}&quot;)<br \/>\n    List hosts<\/p>\n<p>    @Value(&quot;#{es.port}&quot;)<br \/>\n    int port<\/p>\n<p>    @Value(&quot;#{es.cluster}&quot;)<br \/>\n    String cluster<\/p>\n<p>    @Bean<br \/>\n    Client getClient() {<br \/>\n        if (!esClient) {<br \/>\n            Settings settings = ImmutableSettings.settingsBuilder().put(&quot;cluster.name&quot;, cluster).build();<br \/>\n            TransportClient transportClient = new TransportClient(settings);<br \/>\n            for (String esHostName : hosts) {<br \/>\n                transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(esHostName, port));<br \/>\n            }<br \/>\n            esClient = transportClient<\/p>\n<p>        }<\/p>\n<p>        return esClient<br \/>\n    }<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n<p>The &#8216;springConfig&#8217; class properties i.e. hosts , port and cluster will automatically bind with their corresponding match with external configuration file, hosts will bind to es.hosts, port bind to es.port and so on.<\/p>\n<p>We can also define the default value in @Value annotation using <b>Elvis operator(?:)<\/b>. Syntax for the same is: #{expression?:default value}.<\/p>\n<p>For Example :<br \/>\n<code>@Value(\"#{es.port?:9200}\")<\/code><\/p>\n<p>Note: Using the @Value(&#8220;#{property_name}&#8221;) annotation to inject configuration properties can sometimes be confusing, especially if we are working with multiple properties.<\/p>\n<p>2. Typesafe Configuration Properties:- Spring Boot provides an alternative method of working with configuration properties that allows strongly typed beans to inject and validate the configuration properties of our application.<\/p>\n<p>For example, the following class represent binding the external configuration in a class using <b>@ConfigurationProperties<\/b> annotation :-<\/p>\n<p>[code]<br \/>\n@Configuration<br \/>\n@EnableConfigurationProperties<br \/>\n@ConfigurationProperties(prefix = &quot;es&quot;)<br \/>\nclass SpringConfig {<br \/>\n    static Client esClient<\/p>\n<p>    List hosts<br \/>\n    int port<br \/>\n    String cluster<\/p>\n<p>    @Bean<br \/>\n    Client getClient() {<br \/>\n        if (!esClient) {<br \/>\n            Settings settings = ImmutableSettings.settingsBuilder().put(&quot;cluster.name&quot;, cluster).build();<br \/>\n            TransportClient transportClient = new  TransportClient(settings);<br \/>\n            for (String esHostName : hosts) {<br \/>\n                transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(esHostName, port));<br \/>\n            }<br \/>\n            esClient = transportClient<\/p>\n<p>        }<\/p>\n<p>        return esClient<br \/>\n    }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>In @ConfigurationProperties annotation we can define property&#8217;s prefix. In our case any property defined with the &#8216;es&#8217; prefix will be mapped onto that &#8216;SpringConfig&#8217; bean, hosts will bind to es.hosts, port bind to es.port and so on.<\/p>\n<p>To validate the external configuaration we can use JSR-303(javax.validate) constraints annotations to our @ConfiqurationPropertis class<\/p>\n<p>For Example:-<\/p>\n<p>[code]<br \/>\n@Configuration<br \/>\n@EnableConfigurationProperties<br \/>\n@ConfigurationProperties(prefix = &quot;es&quot;)<br \/>\nclass SpringConfig {<br \/>\n    static Client esClient<\/p>\n<p>    @NotNull<br \/>\n    List hosts<\/p>\n<p>    @NotNull<br \/>\n    int port<\/p>\n<p>    @NotNull<br \/>\n    String cluster<\/p>\n<p>    @Bean<br \/>\n    Client getClient() {<br \/>\n        if (!esClient) {<br \/>\n            Settings settings = ImmutableSettings.settingsBuilder().put(&quot;cluster.name&quot;, cluster).build();<br \/>\n            TransportClient transportClient = new  TransportClient(settings);<br \/>\n            for (String esHostName : hosts) {<br \/>\n                transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(esHostName, port));<br \/>\n            }<br \/>\n            esClient = transportClient<\/p>\n<p>        }<\/p>\n<p>        return esClient<br \/>\n    }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>The above @ConfiqurationProperties class will validate against null values. And we can also add a custom Spring Validator by creating a bean definition called <b>ConfigurationPropertiesValidator<\/b>.<\/p>\n<p>Hope this helps you \ud83d\ude42<\/p>\n<p>Get in touch with our team to discuss <a title=\"spring consulting\" href=\"https:\/\/tothenewco.pro\/java-development-services\">your project on Spring<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, In this blog\u00a0we&#8217;ll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese [&hellip;]<\/p>\n","protected":false},"author":92,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":38,"footnotes":""},"categories":[1],"tags":[2009,2012,207,1202,2011,2010],"class_list":["post-23172","post","type-post","status-publish","format-standard","hentry","category-technology","tag-value","tag-configurationproperties","tag-externalized-configuration","tag-spring-boot","tag-type-safe-configuration","tag-value-annotation"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hi, In this blog we&#039;ll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Ashu Kohli\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Binding External Configuration properties in spring boot application | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Hi, In this blog we&#039;ll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"article:tag\" content=\"technology\" \/>\n\t\t<meta property=\"article:tag\" content=\"@value\" \/>\n\t\t<meta property=\"article:tag\" content=\"configurationproperties\" \/>\n\t\t<meta property=\"article:tag\" content=\"externalized configuration\" \/>\n\t\t<meta property=\"article:tag\" content=\"spring boot\" \/>\n\t\t<meta property=\"article:tag\" content=\"type safe configuration\" \/>\n\t\t<meta property=\"article:tag\" content=\"value annotation \\\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2015-07-22T18:57:37+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-08-26T11:59:19+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Binding External Configuration properties in spring boot application | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hi, In this blog we&#039;ll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#article\",\"name\":\"Binding External Configuration properties in spring boot application | TO THE NEW Blog\",\"headline\":\"Binding External Configuration properties in spring boot application\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ashu\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2015-07-23T00:27:37+05:30\",\"dateModified\":\"2016-08-26T17:29:19+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#webpage\"},\"articleSection\":\"Technology, @value, ConfigurationProperties, externalized configuration, spring boot, type safe configuration, value annotation \\\\\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#listItem\",\"name\":\"Binding External Configuration properties in spring boot application\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#listItem\",\"position\":3,\"name\":\"Binding External Configuration properties in spring boot application\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ashu\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ashu\\\/\",\"name\":\"Ashu Kohli\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f96e57c50d32a3114a65e89ea2c9319e9f84070eabaf586a66d8703d5d483ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Ashu Kohli\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/\",\"name\":\"Binding External Configuration properties in spring boot application | TO THE NEW Blog\",\"description\":\"Hi, In this blog we'll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/binding-external-configuration-properties-in-spring-boot-application\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ashu\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ashu\\\/#author\"},\"datePublished\":\"2015-07-23T00:27:37+05:30\",\"dateModified\":\"2016-08-26T17:29:19+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Binding External Configuration properties in spring boot application | TO THE NEW Blog","description":"Hi, In this blog we'll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese","canonical_url":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#article","name":"Binding External Configuration properties in spring boot application | TO THE NEW Blog","headline":"Binding External Configuration properties in spring boot application","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/ashu\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"datePublished":"2015-07-23T00:27:37+05:30","dateModified":"2016-08-26T17:29:19+05:30","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#webpage"},"articleSection":"Technology, @value, ConfigurationProperties, externalized configuration, spring boot, type safe configuration, value annotation \\"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/tothenewco.pro\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#listItem","name":"Binding External Configuration properties in spring boot application"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#listItem","position":3,"name":"Binding External Configuration properties in spring boot application","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/ashu\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/ashu\/","name":"Ashu Kohli","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/6f96e57c50d32a3114a65e89ea2c9319e9f84070eabaf586a66d8703d5d483ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"Ashu Kohli"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/","name":"Binding External Configuration properties in spring boot application | TO THE NEW Blog","description":"Hi, In this blog we'll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/ashu\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/ashu\/#author"},"datePublished":"2015-07-23T00:27:37+05:30","dateModified":"2016-08-26T17:29:19+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"article","og:title":"Binding External Configuration properties in spring boot application | TO THE NEW Blog","og:description":"Hi, In this blog we'll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese","og:url":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","article:tag":["technology","@value","configurationproperties","externalized configuration","spring boot","type safe configuration","value annotation \\"],"article:published_time":"2015-07-22T18:57:37+00:00","article:modified_time":"2016-08-26T11:59:19+00:00","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Binding External Configuration properties in spring boot application | TO THE NEW Blog","twitter:description":"Hi, In this blog we'll learn how we can inject configuration properties in a springBoot application and what are the benefits of spring boot over spring while injecting configuration properties. There are two ways to inject our configuration properties:- 1. By Using @Value annotation (Spring 3.0+ And Grails 3.0) 2. Typesafe Configuration Properties (Sring-Boot) Lets suppoese","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"23172","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"article","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 13:09:01","updated":"2024-02-29 08:43:24","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBinding External Configuration properties in spring boot application\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Technology","link":"https:\/\/tothenewco.pro\/blog\/category\/technology\/"},{"label":"Binding External Configuration properties in spring boot application","link":"https:\/\/tothenewco.pro\/blog\/binding-external-configuration-properties-in-spring-boot-application\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/23172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=23172"}],"version-history":[{"count":0,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/23172\/revisions"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=23172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=23172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=23172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}