You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/03/13 10:21:00 UTC

[jira] [Assigned] (CAMEL-14670) @PropertyInject : support for complex - non primitive - injection

     [ https://issues.apache.org/jira/browse/CAMEL-14670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-14670:
-----------------------------------

    Assignee: Claus Ibsen

> @PropertyInject : support for complex - non primitive - injection
> -----------------------------------------------------------------
>
>                 Key: CAMEL-14670
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14670
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 3.2.0
>
>
> Camel has a @PropertyInject annotation that works for primitives but it would be nice to support complex objects so that one can write:
> {code:java}
> @BindToRegistry
> public static AmazonS3 minioClient(
>         @PropertyInject("minio") MinioConfig config) {
>     var endpoint = new AwsClientBuilder.EndpointConfiguration(config.getAddress(), "US_EAST_1");
>     var credentials = new BasicAWSCredentials(config.getAccessKey(), config.getSecretKey());
>     var credentialsProvider = new AWSStaticCredentialsProvider(credentials);
>     return AmazonS3ClientBuilder
>         .standard()
>         .withEndpointConfiguration(endpoint)
>         .withCredentials(credentialsProvider)
>         .withPathStyleAccessEnabled(true)
>         .build();
> }
> {code}
> And have _minio_ interpreted as properties root so that users can define properties like:
> {code}
> minio.address = http://my-minio.com
> minio.access-key = ...
> minio.secret-key = ...
> {code}
> And receive a _MinioConfig_ object configured from those options as method parameter.
> As today it is possible to achieve a similar behaviour using _@BeanInject_ in combination with https://issues.apache.org/jira/browse/CAMEL-14525 but I think it would be nice to support such case too.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)