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/07/19 08:19:00 UTC

[jira] [Comment Edited] (CAMEL-15310) AWS S3 - Support for more than 1 client in the registry

    [ https://issues.apache.org/jira/browse/CAMEL-15310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17160601#comment-17160601 ] 

Claus Ibsen edited comment on CAMEL-15310 at 7/19/20, 8:18 AM:
---------------------------------------------------------------

That is logic to detect if there is a single bean in the registry and use it by default, unless you explicit configure it to use a specific bean.

But it may be that this logic is flawed and that if you set a custom bean then its not used, but that default instead. That needs to be investigated.

An unit test would be nice contribution to reproduce this.



was (Author: davsclaus):
That is likely logic to detect if there is a single bean in the registry and use it by default, unless you explicit configure it to use a specific bean.



> AWS S3 - Support for more than 1 client in the registry
> -------------------------------------------------------
>
>                 Key: CAMEL-15310
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15310
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws-s3
>    Affects Versions: 3.1.0, 3.4.1
>            Reporter: Christophe Willemsen
>            Assignee: Andrea Cosentino
>            Priority: Minor
>
> The `amazonS3Client` query parameter takes the key of the bean in the registry as argument, however that key is not used.
>  
> Actually, today the component supports *ONLY* having 1 bean of type AmazonS3 in the registry, the following method in the S3Component shows it : 
>  
>  
> {code:java}
> private void checkAndSetRegistryClient(S3Configuration configuration) {
>     Set<AmazonS3> clients = this.getCamelContext().getRegistry().findByType(AmazonS3.class);
>     if (clients.size() == 1) {
>         configuration.setAmazonS3Client((AmazonS3)clients.stream().findFirst().get());
>     }
> }
> {code}



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