Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
Camel has a @PropertyInject annotation that works for primitives but it would be nice to support complex objects so that one can write:
@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(); }
And have minio interpreted as properties root so that users can define properties like:
minio.address = http://my-minio.com
minio.access-key = ...
minio.secret-key = ...
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.
Attachments
Issue Links
- is related to
-
CAMEL-14716 @BeanConfigInject add support for Map
- Resolved
- relates to
-
CAMEL-14525 provide a bean definition to the auto configuration by property feature
- Resolved