Forum Home » Fuse Distributions » Fuse Mediation Router

Thread: Streaming Data Format

 

Permlink Replies: 2 - Last Post: Jan 30, 2012 7:40 PM Last Post By: jamie3
jamie3

Posts: 131
Registered: 07/24/08
Streaming Data Format
Posted: Jan 30, 2012 3:31 PM
  Click to reply to this thread Reply
I have a case where I have a large input stream that I would like to read from and unmarshal into multiple Camel Exchanges.

Currently the DataFormat interface requires you to return an Object after reading from the entire input stream. Ideally I would like my unmarshaller to create exchanges on the fly while consuming from the input stream.

I didn't see anything in the documentation regarding streamed unmarshallers.

from("source") // receives one big message
.unmarshal(new MyDataFormat()) // output numerous exchanges
.to("destination");
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: Streaming Data Format
Posted: Jan 30, 2012 6:48 PM   in response to: jamie3 in response to: jamie3
  Click to reply to this thread Reply
You can use the Splitter EIP, to split the stream into multiple exchanges.
jamie3

Posts: 131
Registered: 07/24/08
Re: Streaming Data Format
Posted: Jan 30, 2012 7:40 PM   in response to: davsclaus in response to: davsclaus
  Click to reply to this thread Reply
.split(body(String.class).tokenize("msg")) did the job!