0

I have to read multiple xml files using Apache camel in spring application then unmarshalling that xml file using JAXB context object.

But the program takes lot of time for creating JAXB context object for each and every time reading new file and calling unmarshaller bean.

I don't need to recreate JAXB context object each and every time.

How to initialize JAXB Context object and jaxb instance (class file) in application.properties ?

Fmerco
  • 1,160
  • 5
  • 20
veera
  • 1
  • (i think) there are no "out-of-the-box" spring(-boot) properties for jaxb, but this is the [current spring - jaxb reference doc](https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#oxm-jaxb) (with xml configuration), here [a java-config sample ;)](https://stackoverflow.com/a/44678803/592355) ..if "jaxb is not a must", you can consider the "jackson"/spring-boot alternatives... ..and if the problem is not in "context creation", but in (xml)"file size" ...then you'd have to consider [tag:jaxp]. – xerx593 Mar 10 '20 at 20:01
  • [see..](https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html), nothing found for "jaxb"...nor "oxm" ...nor "marsh" ..but a lot of "spring.jackson*" – xerx593 Mar 10 '20 at 20:08
  • How are you using those 'xml' files in Camel? Perhaps posting the route would be helpful. Include your camel version too. – ShellDragon Mar 10 '20 at 20:30

0 Answers0