On Sun, Oct 21, 2012 at 1:16 AM, maheshadepu <[email protected]> wrote:
> I have xml structure like this.
>
> <metadata>
> <numberoforders>2</numberoforders>
> <metadatatype>abc</metadatatype>
> </metadata>
> <order>
> <order>
> </order>
> <order>
> </order>
> </order>
>
> My requirement is i have to validate number of order nodes that xml have &
> and count that i will get thru metadata. Lets say if it is more than 1000
> nodes i can split & stream. and save each order bean to DB.
> I can split & stream using following DSL code.
>

You can pre-process the message and extract information from the xml
metadata, and store that as headers on the message.
Then each splitted message have access to these headers, and thus can
access that data.

You can the composed message processor eip
http://camel.apache.org/composed-message-processor.html

To validate that the number of splitted messages matches what you had
as counter in the meta-data. You can associate an aggregation strategy
to the splitter, and in that logic you can keep counter on number of
splitted messages.

Then when the splitter is done, you can validate if this matches what
you expect.


> <route>
>   <from uri="file:xmldir"/>
>   <split streaming="true">
>     <tokenize token="order" xml="true"/>
>     <to uri="bean:order"/>
>   </split>
> </route>
>
> I have three questions.
> 1) Where can I validate metadata order count and the number of orders.
> 2) I want to enable streaming based on order node count
> 3) when I am processing each order i want to set meta data ( I have to
> access metadata node).
>
> I know I am asking solution. :). I am thankful to you please refer to me
> any examples or ideas.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Stax-componenet-tp5721197p5721341.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to