Paolo Morandini created CAMEL-6899:
--------------------------------------

             Summary: Stream component has various problems. 
                 Key: CAMEL-6899
                 URL: https://issues.apache.org/jira/browse/CAMEL-6899
             Project: Camel
          Issue Type: Bug
          Components: camel-stream
    Affects Versions: 2.12.1
         Environment: Java 7, Mac OS X
            Reporter: Paolo Morandini


Camel stream component has several issues (when using it to transfer big, 
finite, files):

- If using groupLines, this component can transfer only a number of lines 
that's a multiple of this parameter (ie. if groupLines=7 and a file consists of 
20 lines you'll send two Exchanges containing rows 1-7 and 8-14, losing rows 
15-20)

- there's no way to know when a stream finished, that renders the 
onCompletion() hook quite useless

- Stream producer can produce only from String or byte[], but stream consumer 
produces either String or List<String>, this makes impossible to use grouping 
to transfer files between two stream endpoints

Fastest workaround I found out is to add the chance to specify additional URL 
parameters in Endpoint configuration (i.e.  stream:url?binary=true... ) thus 
allowing the Consumer to read chunks of files into byte[] and packing them into 
an Exchange.

My feeling is that the entire component could be enlisted to go under a deeper 
review and major refactoring.

I'm attaching a Patch for your evaluation that should temporarily fix this 
mis-behaviors, at leas in my working scenario (but I think they're pretty 
generic).



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to