Repository navigation
Migration Guide 3.39
|
Note
|
We highly recommend the use of Items marked below with ⚙️ ✅ are automatically handled by |
-
Package renamed from
io.quarkus.hibernate.panachetoio.quarkus.data.hibernate -
PanacheEntitywas split intoManagedEntity(forSession-backed entities) andRecordEntity(forStatelessSession-backed entities) -
Use
.Reactivesuffix (first) for the reactive variant -
Use
.CustomIdsuffix (second) if you want to define your own@Id -
Similarly for
PanacheRepository -
PanacheQueryrenamed toDataQuery -
Most internal types renmaed to drop the
PanacheorPanache Nextnames and better readability -
Switched from
org.hibernate:hibernate-jpamodelgenannotation processor toio.quarkus:quarkus-data-processor
Quarkus now uses Apache Avro 1.12.2.
Starting with this version, Avro checks every class against a global security validator before deserializing it.
If the class is not trusted, deserialization fails with a java.lang.SecurityException.
The quarkus-avro extension comes in transitively with quarkus-apicurio-registry-avro, quarkus-confluent-registry-avro and quarkus-messaging-pulsar.
It installs a validator that automatically trusts the following classes:
-
Avro-generated classes, meaning those annotated with
@org.apache.avro.specific.AvroGenerated. -
Protobuf-generated messages in applications that use
quarkus-grpcorquarkus-messaging-pulsar. -
Avro’s built-in trusted types, such as boxed primitives,
String,BigDecimalandBigInteger.
Applications that only deserialize Avro-generated classes do not need to change anything.
If your application deserializes other classes through Avro, for example reflect-based POJOs, trust them with the new build-time properties:
# Trust individual classes by fully qualified name (use `$` for nested classes, e.g. org.acme.Outer$Inner)
quarkus.avro.trusted-classes=org.acme.MyClass,org.acme.OtherClass
# Trust whole packages, including their sub-packages
quarkus.avro.trusted-packages=org.acme.modelBecause these are build-time properties, you need to rebuild the application after changing them.
At runtime, you can still use Avro’s own org.apache.avro.SERIALIZABLE_CLASSES and org.apache.avro.SERIALIZABLE_PACKAGES system properties to trust more classes.
If you use the Avro library without the quarkus-avro extension, those system properties are the only option.
|
Important
|
In One way to do this is to set the system property in the Maven Failsafe configuration: <plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<org.apache.avro.SERIALIZABLE_PACKAGES>org.acme.schema</org.apache.avro.SERIALIZABLE_PACKAGES>
</systemPropertyVariables>
</configuration>
</plugin>The other way is to install a validator programmatically before the test consumes any messages, for example in a ClassSecurityValidator.setGlobal(ClassSecurityValidator.composite(
ClassSecurityValidator.builder().add(MyRecord.class).build(),
ClassSecurityValidator.getGlobal()));
|
See the Avro deserialization and class security section of the Kafka Schema Registry and Avro guide for details.
Since Avro 1.12.2, Avro rejects untrusted classes during deserialization.
If your extension generates or handles classes that are deserialized through Avro, mark them as trusted.
Add a dependency on io.quarkus:quarkus-avro-spi to your deployment module and produce an io.quarkus.avro.spi.AvroTrustedClassBuildItem for those classes.
@BuildStep
AvroTrustedClassBuildItem trustMyClasses() {
return new AvroTrustedClassBuildItem(List.of("org.acme.MyGeneratedClass"));
}The build item has no effect if the quarkus-avro extension is not present, so your extension does not need to depend on quarkus-avro.