// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-avro"]
= Avro
:page-aliases: extensions/avro.adoc
:linkattrs:
:cq-artifact-id: camel-quarkus-avro
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Serialize and deserialize messages using Apache Avro binary data format.
:cq-deprecated: false
:cq-jvm-since: 1.0.0
:cq-native-since: 1.0.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##
endif::[]

Serialize and deserialize messages using Apache Avro binary data format.

[id="extensions-avro-whats-inside"]
== What's inside

* xref:{cq-camel-components}:dataformats:avro-dataformat.adoc[Avro data format]

Please refer to the above link for usage and configuration details.

[id="extensions-avro-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-avro[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-avro</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-avro-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

Beyond standard usages known from vanilla Camel, Camel Quarkus adds the possibility to parse the Avro schema at build time both in JVM and Native mode.

The approach to generate Avro classes from Avro schema files is the one coined by the `quarkus-avro`  extension. It requires the following:

1. Store `*.avsc` files in a folder named `src/main/avro` or `src/test/avro`
2. In addition to the usual `build` goal of `quarkus-maven-plugin`, add the `generate-code` goal:
+
[source,xml]
----
<plugin>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>generate-code-and-build</id>
            <goals>
                <goal>generate-code</goal>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
</plugin>
----

Please see a working configuration in link:https://github.com/apache/camel-quarkus/tree/main/integration-tests/avro[Camel Quarkus Avro integration test] and link:https://github.com/quarkusio/quarkus/tree/main/integration-tests/avro-reload/src/test/avro[Quarkus Avro integration test].

