2

I am trying to integrate a simple Enterprise App to a data source(xml file for now) using Apache Service Mix(ASM) ESB. Basically I need to have the ESB pick up content from the xml file and populate corresponding tables in a H2 database(which my app is linked to). I am not sure as to which features of ASM I should be using for the same. If someone could give me a high level idea as to how I should be going about the same I would be very grateful. I have looked at documentation from Fuse ESB and also the ASM documentation but at this point I am totally confused.

Thanks in advance.

рüффп
  • 5,172
  • 34
  • 67
  • 113

1 Answers1

0

Since ServiceMix uses Camel for such work, my first suggestion is to take a look at Apache Camel for it.

For you're example a simple route would look like this:

from("file:location_of_file").unmarshal(registered-jaxB-structure)
.split(simple("probably_your_entities")).to("jdbc:dataSource?sql_insert");

You read your incoming file from the *location_of_file* unmarshall it since it's a XML file to your object-structure with jaxb. After that you probably need to iterate over the entities inside your xml file which is best be done with a split. Now your structure is most likely in a way you can use either for storing with jpa, sql or jdbc.

Achim Nierbeck
  • 5,265
  • 2
  • 14
  • 22