THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- marshal = currently not supported by Smmoks Smooks
- unmarshal = from stream to XML (can be used when reading EDI files)
...
setSmooksConfig(configfile)
= a fully Smmoks Smooks configuration filesetMappingModel(modelfile)
= just the mapping model xml file and Camel will use a default Smmoks Smooks configuration
To use the data format simply instantiate an instance, set the configuration (above) and invoke the unmarshal operation in the route builder:
Code Block | ||||
---|---|---|---|---|
| ||||
DataFormat edi = new EDIDataFormat(); edi.setMappingModel("my-order-mapping.xml"); ... from("file://edi/in"). unmarshal(edi). to("jms:queue:edi"); |
And you can also provide the full Smmoks Smooks configuration file where you can configure Smmoks Smooks as you want, in case the default configuration isn't useful:
Code Block | ||||
---|---|---|---|---|
| ||||
DataFormat edi = new EDIDataFormat(); edi.setSmooksConfig("my-smooks-config.xml"); ... from("file://edi/in"). unmarshal(edi). to("jms:queue:edi"); |
The default configuration file is provided as a resource in the jar in the location: org/apache/camel/dataformat/edi/default-smooks-config.xml