// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
= Avro
:page-aliases: extensions/avro.adoc
:cq-artifact-id: camel-quarkus-avro
:cq-native-supported: true
:cq-status: 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

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.0.0##

Serialize and deserialize messages using Apache Avro binary data format.

== 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.

== Maven coordinates

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-avro</artifactId>
</dependency>
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== 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 via the `@BuildTimeAvroDataFormat` annotation.

For instance below, in the first step the `user.avsc` schema resource is parsed at build time.
In the second step, an AvroDataFormat instance using the previously parsed schema is injected in the `buildTimeAvroDataFormat` field at runtime. At the end of the day, the injected data format is used
from the `configure()` method in order to marshal an incoming message.
[source,java]
----
@BuildTimeAvroDataFormat("user.avsc")
AvroDataFormat buildTimeAvroDataFormat;

@Override
public void configure() {
  from("direct:marshalUsingBuildTimeAvroDataFormat").marshal(buildTimeAvroDataFormat);
}
----

