amazon-web-services - 如何在骆驼的休息组件中执行from语句?
问题描述
我为此使用 apache camel。我有一个 http 服务器。当我对 url 执行 get 请求时,它应该从 aws s3 中的存储桶中获取文件,然后在我的本地目录中创建一个文件。
public static class HelloRoute extends RouteBuilder {
@Override
public void configure() {
rest("/")
.get("file-from-s3")
.route()
.from("aws2-s3://bucketname?accessKey=INSERT&secretKey=INSERT®ion=us-east-1&prefix=hello.txt")
.to("file:/tmp/")
.endRest();
}
我为此编写了上面的代码,但看起来它忽略了“from”语句并直接执行“to”语句,因此在我的 tmp 目录中创建了一个空文件。还有其他方法可以做到这一点吗?
解决方案
推荐阅读
- vb.net - NPOI Read and write 移除复选框的格式控制
- c# - 如何在windows窗体中创建多个页面而不创建多个窗体
- javascript - 如何在反应中取消 setTimeout 时间
- stm32 - 如何确保我的所有数据都在 CAN 总线上发送和接收?
- python - 我们可以从 Ansible 将数据推送到 Kafka,而无需在 Ansible 控制器主机(可能是 Ansible Tower)上安装任何额外的 python 模块吗?
- laravel - Laravel - 如何获取要执行的迁移列表?
- html - 如何修复内容安全策略错误?
- java - 如何包含具有 Maven 依赖项的本地工件:go-offline
- linux - 在单个会话中运行 VSCode 任务
- sql - SQL 查询以求和日期之前的列并显示该日期之后的所有条目