31.5.5. 高级 AmazonS3 配置
如果您的 Camel 应用程序正在防火墙后面运行,或者您需要对 AmazonS3 实例配置进行更多控制,您可以创建自己的实例:
AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey");
ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost("http://myProxyHost");
clientConfiguration.setProxyPort(8080);
AmazonS3 client = new AmazonS3Client(awsCredentials, clientConfiguration);
registry.bind("client", client);并在您的 Camel aws-s3 组件配置中引用它:
from("aws-s3://MyBucket?amazonS3Client=#client&delay=5000&maxMessagesPerPoll=5")
.to("mock:result");