优雅的方式来创建EC2存储在S3上的图像的缩略图,并与完成轨沟通? [英] Elegant way to create thumbnails of images stored on s3 with ec2 and communicate with rails on finish?
问题描述
OK,我的设置,什么我要完成这么一个简单的总结:
OK, so a quick summary of my setup and what i want to accomplish:
-
我有一个轨运行我的网站2.3.5服务器。我有我的网站上,用户可以上传图片直接到S3 Flash应用程序。
I have a rails 2.3.5 server that runs my website. I have a flash application on my site where users can upload images directly to s3.
当上传完成后,钢轨通知。
When an upload is completed, rails is notified.
目前在图像完成上传到S3和铁轨被告知这一点,我想轨一些邮寄的东西位于EC2创建两个缩略图(110x110和600×600)。
At the point where the image is finished uploading to s3 and rails is notified, i want rails to send some post to something located on ec2 to create two thumbnails (110x110 and 600x600).
在创建并转移到S3的缩略图,我想不管过程在EC2上一个邮寄回轨,以通知缩略图创建完成,并在S3上。
When the thumbnails are created and transferred to s3, i want whatever process on ec2 to send a post back to rails to notify that the thumbnail creation is finished and are on s3.
什么是实现这一目标的最佳方式是什么?我看过的工具,如刀很简单,但我不熟都使用EC2或类似的服务。
What is the best way to accomplish this? I have looked at tools such as knife very briefly but I'm not familiar at all with using ec2 or similar services.
感谢
推荐答案
我会在使用的过程是这样的:
The process that I would use is the following:
-
一旦图像上传到S3,轨得到通知,并将其添加一个消息到Amazon SQS队列(见 HTTP: //aws.amazon.com/sqs/ )
在EC2上运行一个后台进程检查队列并处理任何消息,生成缩略图
A background process running on EC2 checks the queue and processes any messages, generating the thumbnails
一旦生成缩略图,通知被使用Amazon SNS(发见 http://aws.amazon.com/ SNS / )和你的Rails应用程序respons该通知
Once a thumbnail is generated, a notification is sent using Amazon SNS (see http://aws.amazon.com/sns/) and your rails app respons to this notification
这篇关于优雅的方式来创建EC2存储在S3上的图像的缩略图,并与完成轨沟通?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!