FTP サーバーから AWS S3 ストレージにファイルを転送するキャメル ルートを作成しようとしています。次のルートを書きました
private static class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception
{
from("sftp://<<ftp_server_name>>&noop=true&include=<<file_name>>...")
.process(new Processor(){
@Override
public void process(Exchange ex)
{
System.out.println("Hello");
}
})
.to("aws-s3://my-dev-bucket ?
accessKey=ABC***********&secretKey=12abc********+**********");
}
問題は、これにより次の例外が発生することです。
Exception in thread "main" org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[aws-s3://my-dev-bucket?accessKey=ABC*******************&secretKey=123abc******************** <<< in route: Route(route1)[[From[sftp://<<ftp-server>>... because of Failed to resolve endpoint: aws-s3://my-dev-bucket?accessKey=ABC***************&secretKey=123abc************** due to: The request signature we calculated does not match the signature you provided. Check your key and signing method.
次に、これを別の方法で実行しようとしました。つまり、次のようなメソッドを記述します。
public void boot() throws Exception {
// create a Main instance
main = new Main();
// enable hangup support so you can press ctrl + c to terminate the JVM
main.enableHangupSupport();
// bind MyBean into the registery
main.bind("foo", new MyBean());
// add routes
AWSCredentials awsCredentials = new BasicAWSCredentials("ABC*****************", "123abc*************************");
AmazonS3 client = new AmazonS3Client(awsCredentials);
//main.bind("client", client);
main.addRouteBuilder(new MyRouteBuilder());
main.run();
}
バインドされた変数 #client を使用して呼び出します。この方法では例外はありませんが、ファイル転送は機能しません。
私のアプローチに問題がないことを確認するために、aws-s3 の代わりに aws-sqs を試してみましたが、問題なく動作しました (ファイルは SQS キューに正常に転送されます)。
なぜこれが起こっているのですか?camel 用の「aws-s3」コネクタに基本的な問題はありますか?