简体   繁体   English

如何在特定时间间隔从 S3 存储桶检查和下载文件?

[英]How to check and download files from S3 bucket in a specific interval?

I want to implement the following once a file is uploaded to aS3 Bucket将文件上传到 aS3 Bucket 后,我想执行以下操作

  1. Download the file to a windows server将文件下载到 windows 服务器
  2. Run a 3rd party exe to process the file and generate an output file on a Windows Server运行第 3 方 exe 来处理文件并在 Windows 服务器上生成 output 文件

What is the best approach to implement this using.Net Core?使用.Net Core 实现这一点的最佳方法是什么?

Solution 1:解决方案1:

  1. Create a Lambda function to Trigger an API创建 Lambda function 以触发 API
  2. API will download the file and process API 将下载文件并处理

Solution 2:解决方案2:

  1. Create an executable to download the file from s3 bucket创建一个可执行文件以从 s3 存储桶下载文件
  2. Create a lambda function trigger an executable创建 lambda function 触发器可执行文件

Solution 3:解决方案3:

  1. Create a service to check and download files from s3 bucket创建服务以检查和下载 s3 存储桶中的文件
  2. The downloaded file will be processed by the service下载的文件将由服务处理

Solution 4:解决方案4:

  1. Use AWS Lambda to push the file to SQS使用 AWS Lambda 将文件推送到 SQS
  2. Create an application to monitor SQS.创建一个应用程序来监控 SQS。

Please let me know the best solution to implement this.请让我知道实现这一点的最佳解决方案。 Sorry for asking this non-technical question.很抱歉问这个非技术性的问题。

The correct architecture approach would be:正确的架构方法是:

  • Create a trigger on the Amazon S3 bucket that sends a message to an Amazon SQS queue when the object is created在创建 object 时在 Amazon S3 存储桶上创建向 Amazon SQS 队列发送消息的触发器
  • A Windows server is continually polling the Amazon SQS queue waiting for a message to appear Windows 服务器不断轮询 Amazon SQS 队列等待消息出现
  • When a message appears, use the information in the message to download the object from S3 and process the file出现消息时,使用消息中的信息从 S3 下载 object并处理文件
  • Upload the result to Amazon S3 and optionally send an SQS message to signal completion (depending on what you wish to do after a file is processed)将结果上传到 Amazon S3 并可选择发送 SQS 消息以指示完成(取决于您希望在处理文件后执行的操作)

This architecture is capable of scaling to large volumes and allows files to be processed in parallel and even across multiple servers.这种架构能够扩展到大容量,并允许并行处理文件,甚至可以跨多个服务器处理文件。 If a processing task fails and does not signal completion, then Amazon SQS will make the message visible again for processing.如果处理任务失败并且未发出完成信号,则 Amazon SQS 将使消息再次可见以进行处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 CLI 将 JSON 文件从 windows 系统中的 AWS S3 存储桶复制到本地 - Copy JSON files to local from AWS S3 bucket in windows system using CLI 如何从 AWS S3 存储下载文件作为字节数组? - How to download a file as Byte Array from AWS S3 Storage? 如何修复从S3存储桶向Windows EC2导入数据的问题 - How to fix data import to Windows EC2 from S3 bucket 将文件上传到 S3 存储桶 - Uploading file to S3 bucket Linux controller 上的 Ansible - s3 模块从 Z0F4137ED1502B5045D6083AA325 主机复制到存储桶 - Ansible on Linux controller - s3 module to copy from windows host to s3 bucket 有什么方法可以通过自动转换为zip格式然后每天以自动方式将aws s3存储桶传输Windows文件 - Is there any way to transfer windows files by automatically convert in zip format and then to aws s3 bucket in an automate way daily 无法将文件上传到S3存储桶 - Unable to upload file to S3 bucket 尝试递归从ftp下载特定文件并在它们上运行命令 - trying to download specific files from ftp recursively and run a command on them Windows AWS Bootstrap,使用CloudFormation处理来自S3的文件 - Windows AWS Bootstrap with files from S3 using CloudFormation 尝试使用 boto3 访问 s3 存储桶,但得到 403 - Trying to access a s3 bucket using boto3, but getting 403
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM