0

我面临一个需要向多播端点发送大文件的情况。我的路线如下。我正在尝试将 100 MB 或更多的单个文件从 abcd 端点发送到 xyz,从 xyz 发送到 efg 和测试队列。我可以将整个 100MB 从 abcd 发送到 xyz,但不能从 xyz 发送到 efg 和测试队列。它仅发送少量文件,多播路由中缺少其他文件。在 fuseesb 日志中也出现 3 种类型的错误:

1. org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: D:\xyz\samplebigfiles.txt at org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:264)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]

2. Caused by: java.io.FileNotFoundException: D:\abcd\samplebigfiles.txt (The process cannot access the file because it is being used by another process)
    at java.io.FileInputStream.open(Native Method)[:1.6.0_22]

3. java heap space error


<route>
  <from uri="file:///D:/abcd" />
   <to uri="file:///D:/xyz" />
</route>
<route>
  <from uri="file:///D:/xyz" />
    <multicast>
    <to uri="file://D:/efg" />
    <to uri="jms:queue:test" />
    </multicast>
</route>

请建议我一些解决方案来解决它。

4

1 回答 1

1

当您处理文件时,您需要考虑使用读锁定策略,以避免读取文件,而另一个进程正在写入文件等。请参阅 Camel 文件文档中的更多详细信息:http: //camel.apache.org /文件2

而且您不应该通过 JMS 队列发送 100MB 的文件。消息传递不是为处理如此大的有效负载而设计的。例如,Apache ActiveMQ 有一个关于此的常见问题解答:http: //activemq.apache.org/can-i-send-really-large-files-over-activemq.html

注意 Apache Camel 不支持 ActiveMQ 提供的特殊 BlobMessage 类型。虽然这个功能很少使用。它实现了带外存储文件,并使用 FTP 传输有效负载。

在传输如此大的有效载荷时谈到 FTP,使用 FTP / SCP 或其他一些方式可能会更好。Camels 有 FTP 和 SCP 组件:

于 2013-03-19T14:37:06.130 回答