Maybe try with stax it works with pojos for splitting
http://camel.apache.org/stax



On Fri, Dec 18, 2015 at 7:26 AM, sonu123 <sandeepghosh...@rediffmail.com> wrote:
> Hi,
>
> In below codes, I am reading a big  XML file and then splitting on some
> CcyXchg element. Until here, codes works.  When I am trying to unmarshal
> into Java Object, I am getting  all properties of CurrencyExchange6 as null.
> Any idea ho w I can convert the part XML into POJO.
> public void configure() throws Exception {
>                 JAXBContext jaxbContext =
> JAXBContext.newInstance(CurrencyExchange6.class);
>                 JaxbDataFormat jaxb = new JaxbDataFormat(jaxbContext);
>                 jaxb.setPrettyPrint(false);
>                 CurrencyExchange6 c=new CurrencyExchange6();
>                 jaxb.setPartClass(c.getClass().getCanonicalName());
>                 jaxb.setFragment(true);
>
> from("file:target/in?noop=true&fileName=camt.086.001.01.xml").log("Content
> of the ISO file: ${body}")
>                 .split().tokenizeXML("CcyXchg")
>                     .streaming().executorService(threadPool)
>                     .log("Content of the splitted file: ${body}")
>                     .unmarshal(jaxb)
>                     .log("Content of the marshalled: ${body}")
>                     .to("seda:update")
>                     .end()
>                     .log("Done processing big file:
> ${header.CamelFileName}");
>
>                 from("seda:update?concurrentConsumers=20")
>                     .bean(InventoryService.class, "doSomeThingHere");
>             }
>
> Thanks in advance
>
> Regards,
> Sonu
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-and-tokenizeXML-not-working-with-Jaxb-unmarshal-with-Part-class-tp5775239.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to