You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ram kumar <ra...@gmail.com> on 2015/06/08 14:15:17 UTC

Query on camel s3

Hi,
I have a producer which points to a directory
I want to consume to s3, inside a particular directory
Can anyone help me with that


.from(file:directoryName)
.setHeader(S3Constants.KEY, simple("check1"))
.to("aws-s3://camel?accessKey=&secretKey=&region=&");

Thanks

Re: Query on camel s3

Posted by "Palmer, Eric" <ep...@richmond.edu>.
This works for me (using the spring syntax)

<bean id="amazonS3Client" class="com.amazonaws.services.s3.AmazonS3Client">
    <constructor-arg>
        <bean class="com.amazonaws.auth.BasicAWSCredentials">
            <constructor-arg value=³accesskey"/>
            <constructor-arg value=³secretkey"/>
        </bean>
    </constructor-arg>
</bean>



<route>
    <from 
uri="file:/somefolder/in?readLock=changed&amp;recursive=true&amp;delay=200"
/>
    <setHeader headerName="CamelAwsS3Key">
        <simple>${file:name}</simple>
    </setHeader>
    <setHeader headerName="CamelAwsS3ContentLength">
        <simple>${file:length}</simple>
    </setHeader>
    <to 
uri="aws-s3://bucketname?amazonS3Client=#amazonS3Client&amp;deleteAfterRead
=false&amp;deleteAfterWrite=true"/>
</route>



You have to give it the file name
You can also put it into a subfolder (key)
<simple>somekeyvalue/${file:name}</simple>



Hope this helps.  I¹m just learning camel so if I did something wrong
please let me know.


--
Eric Palmer
Director of Web Services
University of Richmond

To submit technical support requests please use this form
http://web.richmond.edu/contact/technical-support.html





On 6/8/15, 8:15 AM, "ram kumar" <ra...@gmail.com> wrote:

>Hi,
>I have a producer which points to a directory
>I want to consume to s3, inside a particular directory
>Can anyone help me with that
>
>
>.from(file:directoryName)
>.setHeader(S3Constants.KEY, simple("check1"))
>.to("aws-s3://camel?accessKey=&secretKey=&region=&");
>
>Thanks