1

我必须使用 WSO2 6.5 EI - Amazon S3 连接器进行 POC。

我的任务是“需要将文件从 Amazon s3 获取到本地,然后将这些文件的值加载到数据库中”</p>

如果上传到存储桶的对象意味着将这些文件移动到本地然后继续进行进一步处理,则只需每 5 分钟观看一次 amazon s3 存储桶。

请指导我做进一步。我面临错误和问题。

特此附上我的示例代理(注意:在任务的帮助下触发代理)。

请看一下。

期待一个积极的答复。

    <target>
        <inSequence>
            <property expression="get-property('transport', 'FILE_NAME')" name="fname" scope="default" type="STRING"/>       
            <property name="contentType" value="text/plain"/>
            <property name="filename" expression="get-property('transport', 'FILE_NAME')"/>
            <log level="custom">
                <property name="log" value="====S3 to Local===="/>
            </log>
            <amazons3.init>
                <accessKeyId>****</accessKeyId>
                <secretAccessKey>****</secretAccessKey>
                <region>****</region>
                <methodType>GET</methodType>
                <contentType>{$ctx:contentType}</contentType>
                <host>BUCKETNAME.s3.REGION.amazonaws.com</host>
                <isXAmzDate>true</isXAmzDate>
                <bucketName>BUCKETNAME</bucketName>
            </amazons3.init>
            <log level="custom">
                <property name="log" value="====After Amazon S3 Init===="/>
            </log>
            <amazons3.getObjectsInBucket>
                <bucketUrl>http://s3.REGION.amazonaws.com/BUCKETNAME</bucketUrl>                
            </amazons3.getObjectsInBucket>
            <log level="custom">
                <property name="log" value="==== After getObjectsInBucket ===="/>                  
                <property name="Notification " value="File - Objects Taken From S3 - Completed"/>
                <property name="filename " expression="get-property('filename')"/>
            </log>
            <send>
                <endpoint name="S3_Response_EP">
                    <address uri="vfs:file:///E:/FromS3"/>
                </endpoint>
            </send>
            <log level="custom">
                <property expression="get-property('filename')" name="filename "/>
                <property name="Notification" value="File - Objects Moved to Local - Completed"/>
            </log>
            <drop/>
        </inSequence>
        <outSequence/>           
        <faultSequence/>
    </target>  
</proxy>
4

0 回答 0