Apache Camel does not seem to support any bean that is to be used within its registry. I am currently trying to add an AWS S3 Client object/bean to the spring configuration without any luck. The bean itself is added to the registry, but when camel goes to use the client object it throws an error similar to this:
Caused by: java.lang.IllegalArgumentException: Could not find a
suitable setter for property: amazonS3Client as there isn't a setter method
with same type: java.lang.String nor type conversion possible: No type
converter available to convert from type: java.lang.String to the
required type: com.amazonaws.services.s3.AmazonS3 with value
#amazonClient
The amazonClient is the aforementioned bean that is added appropriately the spring config which has led me to believe the camel config is indeed finding the bean. Here is the related xml configuration:
<!-- set up default amazon s3 client from amazon aws sdk -->
<bean id="amazonClient" class="com.amazonaws.services.s3.AmazonS3Client">
<constructor-arg>
<bean class="com.amazonaws.auth.BasicAWSCredentials">
<constructor-arg name="accessKey" value=""/>
<constructor-arg name="secretKey" value=""/>
</bean>
</constructor-arg>
</bean>
Within the camel context section (you can see the bean is mentioned):
<camel:route id="importFilesFromS3">
<camel:from uri="aws-s3://intuit-commerce-imports?amazonS3Client=#amazonClient&region=us-west-2&deleteAfterRead=true"/>
<camel:to uri="ref:importProcessingEndpoint"/>
</camel:route>
Apache camel claims to have this feature in their documentation, but I have found a few sources that come across the same issue. The answer in the link does not provide much explanation.