Spring Boot: Multiple similar ConfigurationProperties with different Prefixes : <p>I'm using Spring Boot and have two very similar services which I'd like to configure in my <code>application.yml</code>.</p>

<p>The configuration looks roughly like this:</p>

<pre><code>serviceA.url=abc.com
serviceA.port=80

serviceB.url=def.com
serviceB.port=8080
</code></pre>

<p>Is it possible to create one class annotated with <code>@ConfigurationProperties</code> and set the prefix at the injection point?</p>

<p>e.g.</p>

<pre><code>@Component
@ConfigurationProperties
public class ServiceProperties {
   private String url;
   private String port;

   // Getters &amp; Setters
}
</code></pre>

<p>and then in the Services itself:</p>

<pre><code>public class ServiceA {

   @Autowired
   @SomeFancyAnnotationToSetPrefix(prefix="serviceA")
   private ServiceProperties serviceAProperties;

   // ....
}
</code></pre>

<p>Unfortunately I haven't found something in the documentation about such a feature... Thank you very much for your help!</p>
