BeanIO
JVM since3.8.0 Native since3.16.0
Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).
Maven coordinates
Or add the coordinates to your existing project:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-beanio</artifactId>
</dependency>
Check the User guide for more information about writing Camel Quarkus applications.
Usage
BeanIO in native mode
XML mapping files
When BeanIO configuration is defined in XML files that are read from the classpath. You must ensure each file is added to the native application image. To do this, add the quarkus.native.resources.includes
configuration property to application.properties
. For example.
quarkus.native.resources.includes=mapping.xml,model/other-mapping.xml
More information about selecting resources for inclusion in the native executable can be found at Embedding resources in native executable.
BeanIO Record classes
All classes that participate in BeanIO marshal / unmarshal operations must be registered for reflection.
This can be achieved with the @RegisterForReflection
annotation or with configuration property quarkus.camel.native.reflection.include-patterns
. For example:
@RegisterForReflection
public class Employee {
...
}
Refer to the Native mode user guide for more information.