尝试确定此工作流程的最佳设计 - c# - 3.0
输入服务器 - jpg、tif、raw、png、mov 类型的文件通过 FTP 传入
每个文件都需要加水印(如果适用),并将元数据添加到文件中
然后每个文件需要移动到订单所在的订单目录生成文件,然后打包为 zip 文件并移动到处理服务器。
文件名是 [orderid_userid_guid].[jpg|tif|mov|png...]
由于我预计卷会增长,所以我不想一次处理一个文件并将其移动到工作流程中。如果可能的话,我更喜欢多线程/异步..
Input Server - files of type jpg,tif, raw,png, mov come in via FTP
Each file needs to be watermarked, if applicable, and meta data added to the file
Then each file needs to be moved to an orders directory where an order file is generated and then packaged as zip file and moved to processing server.
The file names are of [orderid_userid_guid].[jpg|tif|mov|png...]
As I expect the volume to grow I dont want to work on one file at a time and move it through the work flow. I would prefer multi threaded/asynchronous if possible..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能会为此设置一个消息排队和处理系统。
一个进程/线程/服务将监视 FTP 服务器,当出现新文件时,将抓取它们并将它们转储到队列中(可能是 MSMQ,或只是一个暂存文件夹等)。
另一个进程监视该队列,当文件出现时,它会监视该队列。出现后,它会抓取它并进行水印/元数据/等操作,然后将其放入另一个队列/文件夹中。
另一个进程监视该队列并获取新文件进行压缩。压缩后,放入另一个队列。
...等等。
您可以在每个队列的末尾设置“工作调度程序”来抓取文件并将它们调度到您想要的任意数量的工作线程。
您不必将其分成这么多单独的进程和队列 - 这由您决定。 “队列”也可以通过多种不同的方式来实现。您可以将 MSMQ 作为开始,但您也可以考虑在文件夹之间移动文件等。WCF 和 Windows Workflow Foundation 可能是首先考虑的好技术。
I might setup a message queuing and processing system for this.
One process/thread/service will monitor the FTP server, and when new files appear, will grab them and dump them into a queue (possibly MSMQ, or just a staging folder, etc.)
Another process monitors this queue, and when a file appears, it grabs it and does watermarking/metadata/etc., then drops it in another queue/folder.
Another process monitors this queue and grabs new files for zipping. After zipping, drop in another queue.
...and so on.
You can setup "work dispatchers" at the end of each queue to grab files and dispatch them to however many worker threads you want.
You don't necessarily have to split it out into this many separate processes and queues - that's up to you to decide. The "queues" can be implemented in a number of different ways as well. You could look at MSMQ as a start, but you might also consider just moving files between folders, etc. WCF and Windows Workflow Foundation might be good technologies to look at first.