简体   繁体   English

使用ESB(WSO2,Mule,花瓣,服务组合)的二进制文件处理

[英]Binary file processing using ESBs (WSO2, Mule, Petals, Service Mix)

I'm keen to use an ESB (probably WSO2, Mule, Petals or Service Mix) on a new project. 我很想在一个新项目中使用ESB(可能是WSO2,Mule,Petals或Service Mix)。

I have a number of business processes/ workflows which will work well in an ESB: however I'm struggling with one particular scenario. 我有许多业务流程/工作流程将在ESB中很好地工作:但是我正在为一种特殊情况而苦苦挣扎。

The basic requirement is to process incoming binary files through a number of stages: 基本要求是通过多个阶段处理传入的二进制文件:

  • pre-processing the file using an external tool; 使用外部工具预处理文件;
  • splitting the file based on some configuration data; 根据一些配置数据拆分文件;
  • processing each of these smaller files to calculate a "score". 处理这些较小的文件中的每一个以计算“得分”。 Some of this will be handled by code I will write, but external software will also be called in some instances; 其中一些将由我将编写的代码处理,但在某些情况下也会调用外部软件;
  • loading all the calculated scores into a database. 将所有计算出的分数加载到数据库中。 This must be done at the end of the flow rather than incrementally (as the primary key will be only be found during processing of the file); 这必须在流程的最后而不是递增地完成(因为主键只能在文件处理期间找到);
  • moving the initial file to an archive area. 将初始文件移动到存档区域。

The incoming files will be dropped into a local directory. 传入的文件将被删除到本地目录中。 All the tools support polling of a directory so this isn't a problem. 所有工具都支持轮询目录,因此这不是问题。

However, from what I've read most of the tools expect the payload of the message to be easily readable so that processing can be performed directly on the payload. 但是,从我阅读的内容来看,大多数工具都希望消息的有效负载易于读取,因此可以直接对有效负载执行处理。 In my case I merely want to use the incoming file to generate my real payload data: the values which I will write to the database. 在我的情况下,我只想使用传入的文件来生成我的真实有效载荷数据:我将写入数据库的值。

Is this a pattern that ESBs can support? 这是ESB可以支持的模式吗? Are there any articles about this kind of data processing with any of the above tools? 有没有关于使用上述任何工具进行此类数据处理的文章? Should I be looking at any other technology/patterns? 我应该看看任何其他技术/模式吗?

Hope this makes sense! 希望这是有道理的!

Many thanks, 非常感谢,

Ken

WSO2 provides capability to listen to the files in the file system. WSO2提供了侦听文件系统中文件的功能。 However, as per your query it seems you need to process a binary file with your proprietary format. 但是,根据您的查询,您似乎需要使用您的专有格式处理二进制文件。 If so, you may use WSO2 ESB vfs transport[1] and you have to implement a custom message formatter and a builder (trivial java code as described on [2]) 如果是这样,则可以使用WSO2 ESB vfs transport [1],并且必须实现自定义消息格式化程序和构建器(如[2]所述的简单Java代码)

[1] http://wso2.org/project/esb/java/4.0.0/docs/samples/transport_samples.html#Sample254 [2] http://charithwiki.blogspot.com/2010/11/how-to-write-axis2-message-builder.html [1] http://wso2.org/project/esb/java/4.0.0/docs/samples/transport_samples.html#Sample254 [2] http://charithwiki.blogspot.com/2010/11/how-to -write-的axis2-消息builder.html

This should be possible with an ESB. ESB应该可以做到这一点。 In particular with UltraESB you could do this with its built-in file transport, which supports the moving of the file after processing to an archive area by default. 特别是对于UltraESB,您可以使用其内置文件传输来完成此操作,该文件传输默认支持在处理后将文件移动到存档区域。

The Splitting and aggregation features of the UltraESB could be used to split the file into parts and process them separately. UltraESB的拆分和聚合功能可用于将文件拆分为多个部分并分别进行处理。 The "score" generation can be done with Java or any other scripting language which leverage the UltraESB API to interact with the message (in this case the part of the file) and its environment. “得分”生成可以使用Java或任何其他脚本语言来完成,这些脚本语言利用UltraESB API与消息(在这种情况下是文件的一部分)及其环境进行交互。

The DB interactions can be easily done with the UltraESB with its data base connection mechanisms. 使用UltraESB及其数据库连接机制可以轻松完成数据库交互。 Further, you could do these updates transactionally with UltraESB. 此外,您可以使用UltraESB以事务方式执行这些更新。

If the file is of a standard CSV or EDI format, then you can use the csv or EDI support to process the file easily. 如果文件是标准CSV或EDI格式,则可以使用csv或EDI支持轻松处理文件。 All these via an extremely easy configuration with either Java or any scripting language. 所有这些都通过使用Java或任何脚本语言的极其简单的配置。

[1] - http://docs.adroitlogic.org/display/esb/Transactional+ESB+use+cases+made+simple+with+the+UltraESB [1] -http://docs.adroitlogic.org/display/esb/Transactional+ESB+use+cases+made+simple+with+the+UltraESB

[2] - http://docs.adroitlogic.org [2] - http://docs.adroitlogic.org

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM