Apache Camel ZipInputStream 通过并行处理关闭 [英] Apache Camel ZipInputStream closed with parallel processing

查看:27
本文介绍了Apache Camel ZipInputStream 通过并行处理关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功地使用 ZipSplitter() 来处理 zip 文件中的文件.如果可能,我想使用并行处理,但调用 parallelProcessing() 会导致流过早关闭.当流被 DefaultStreamCachingStrategy 缓存时,这会导致 IOException.

I am successfully using ZipSplitter() to process files inside a zip file. I would like to use parallel processing if possible, but calling parallelProcessing() results in the stream being closed prematurely. This results results in an IOException when the stream is being cached by DefaultStreamCachingStrategy.

我注意到,当启用并行处理时,会调用 ZipIterator#checkNullAnswer(Message) 来关闭 ZipInputStream.奇怪的是,如果我在我的调试器中徘徊在这个方法上,一切都是花哨的,这表明迭代器在处理完成之前就被关闭了.这是一个错误还是我搞砸了什么?

I note that when parallel processing is enabled, ZipIterator#checkNullAnswer(Message) is called which closes the ZipInputStream. Curiously, everything is dandy if I loiter on this method in my debugger, which suggests that the iterator is being closed before processing has completed. Is this a bug or have I messed up something?

表现出这种行为的我的路线的简化版本是:

A simplified version of my route which exhibits this behaviour is:

from("file:myDirectory").
    split(new ZipSplitter()).streaming().parallelProcessing().
        log("Validating filename ${file:name}").
    end();

这是使用 Camel 2.13.1.

This is using Camel 2.13.1.

推荐答案

你可以尝试应用 CAMEL-7415进入camel 2.13.1分支?
我不确定它是否可以解决您的问题,但值得一试.

Can you just try to apply the CAMEL-7415 into the camel 2.13.1 branch?
I'm not quit sure if it can fix your issue, but it is worth to give it a shot.

这篇关于Apache Camel ZipInputStream 通过并行处理关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆