0

I have a collection of domain objects that are transformed into a JAXB class generated from an XSD. The XML and JAXB class has the following structure:

<message>
  <part>...</part>
  <part>...</part>
  <part>...</part>
</message>

How would you do this in Camel to avoid an OutOfMemoryError? The transformation completes without problems, but when I try to marshal into XML I quickly run into memory issues.

I've been looking into JAXB fragments and partial marshalling, but without any luck. Any advice is highly appreciated!

l3dx
  • 2,930
  • 6
  • 33
  • 43
  • How big is the object/xml? If they are truly big, you'll need to stream the xml and hopefully the destination can take a stream. See this other answer: http://stackoverflow.com/questions/1775202/how-to-stream-large-files-using-jaxb-marshaller – Augusto Sep 21 '15 at 20:40
  • The produced XML is close to 200M. But I noticed in visualvm that I was running on a smaller heap than expected. My pom.xml overrode what I told Intellij. Now it runs fine. See https://devnet.jetbrains.com/message/5546536#5546536 – l3dx Sep 22 '15 at 08:40

0 Answers0