title: Kotlin spring-boot @ConfigurationProperties
body: <p>I'm trying to create the following bean <code>AmazonDynamoDBAsyncClientProvider</code>. I've application.properties that defines <code>endpoint</code> and <code>tablePrefix</code> which I'm trying to inject using <code>@ConfigurationProperties</code></p>
  
  <p>Following is the code snippet for the same. When I run my spring-boot app it doesn't work.</p>
  
  <p>I've tried doing the same <code>ConfigurationProperties</code> class using a regular java class which does set those properties but when it comes to <code>AmazonDynamoDBAsyncClientProvider</code>, the properties are empty. What am I missing here? </p>
  
  <pre><code>@Component
  open class AmazonDynamoDBAsyncClientProvider @Autowired constructor(val dynamoDBConfiguration: DynamoDBConfig){
  
  @Bean open fun getAmazonDBAsync() = AmazonDynamoDBAsyncClientBuilder.standard()
          .withEndpointConfiguration(
                  AwsClientBuilder.EndpointConfiguration(dynamoDBConfiguration.endpoint, dynamoDBConfiguration.prefix))
          .build()
  }
  </code></pre>
  
  <p>here is the kotlin bean that I'm trying to autowire with configuration</p>
  
  <pre><code>@Component
  @ConfigurationProperties(value = "dynamo")
  open class DynamoDBConfig(var endpoint: String="", var prefix: String="")
  </code></pre>
  
  <p>finally heres the regular java bean that does get populated with <code>ConfigurationProperties</code> but when it gets <code>Autowired</code> I see those properties being empty/null</p>
  
  <pre><code>@Component
  @ConfigurationProperties("dynamo")
  public class DynamoDBConfiguration {
  private String endpoint;
  private String tablePrefix;
  
  public String getEndpoint() {
      return endpoint;
  }
  
  public void setEndpoint(String endpoint) {
      this.endpoint = endpoint;
  }
  
  public String getTablePrefix() {
      return tablePrefix;
  }
  
  public void setTablePrefix(String tablePrefix) {
      this.tablePrefix = tablePrefix;
  }
  }
  </code></pre>