이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 1. Migrating applications to Red Hat build of Quarkus 3.2
As an application developer, you can migrate applications that are based on earlier versions of Red Hat build of Quarkus to version 3.2 by using the Quarkus CLI’s update command.
The Quarkus CLI is intended for dev mode only. Red Hat does not support using the Quarkus CLI in production environments.
1.1. Updating projects to the latest Red Hat build of Quarkus version 링크 복사링크가 클립보드에 복사되었습니다!
You can update or upgrade your Red Hat build of Quarkus projects to the latest version by using an update command.
The update command primarily employs OpenRewrite recipes to automate updates for most project dependencies, source code, and documentation. Although these recipes perform many migration tasks, they do not cover all the tasks detailed in the migration guide.
Post-update, if expected updates are missing, consider the following reasons:
-
The recipe applied by the
updatecommand might not include a migration task that your project requires. - Your project might use an extension that is incompatible with the latest Red Hat build of Quarkus version.
For projects that use Hibernate ORM or Hibernate Reactive, review the Hibernate ORM 5 to 6 migration quick reference. The following update command covers only a subset of this guide.
1.1.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- Roughly 30 minutes
- An IDE
-
JDK 11+ installed with
JAVA_HOMEconfigured appropriately - Apache Maven 3.8.6 or later
- Optionally, the Red Hat build of Quarkus CLI if you want to use it
- Optionally Mandrel or GraalVM installed and configured appropriately if you want to build a native executable (or Docker if you use a native container build)
- A project based on Red Hat build of Quarkus version 2.13 or later.
1.1.2. Procedure 링크 복사링크가 클립보드에 복사되었습니다!
- Create a working branch for your project by using your version control system.
-
To use the Red Hat build of Quarkus CLI in the next step, install the latest version of the Red Hat build of Quarkus CLI. Confirm the version number using
quarkus -v. - Configure your extension registry client as described in the Configuring Red Hat build of Quarkus extension registry client section of the Quarkus "Getting Started" guide.
To update using the Red Hat build of Quarkus CLI, go to the project directory and update the project to the latest stream:
To update using Maven instead of the Red Hat build of Quarkus CLI, go to the project directory and update the project to the latest stream:
- Ensure that the Red Hat build of Quarkus Maven plugin version aligns with the latest supported Red Hat build of Quarkus version.
Configure your project according to the guidelines provided in the Getting started with Quarkus guide.
mvn com.redhat.quarkus.platform:quarkus-maven-plugin:3.2.12.SP1-redhat-00003:update
mvn com.redhat.quarkus.platform:quarkus-maven-plugin:3.2.12.SP1-redhat-00003:updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: By default, this command updates to the latest current version. To update to a specific stream instead of latest current version, add the
streamoption to this command followed by the version; for example:-Dstream=3.2
- Analyze the update command output for potential instructions and perform the suggested tasks if necessary.
- Use a diff tool to inspect all changes.
- Review the migration guide for items that were not updated by the update command. If your project has such items, implement the additional steps advised in these topics.
- Ensure the project builds without errors, all tests pass, and the application functions as required before deploying to production.
Before deploying your updated Red Hat build of Quarkus application to production, ensure the following:
- The project builds without errors.
- All tests pass.
- The application functions as required.
1.2. Changes that affect compatibility with earlier versions 링크 복사링크가 클립보드에 복사되었습니다!
This section describes changes in Red Hat build of Quarkus 3.2 that affect the compatibility of applications built with earlier product versions.
Review these breaking changes and take the steps required to ensure that your applications continue functioning after you update them to Red Hat build of Quarkus 3.2.
To automate many of these changes, use the quarkus update command to update your projects to the latest Red Hat build of Quarkus version.
1.2.1. Cloud 링크 복사링크가 클립보드에 복사되었습니다!
1.2.1.1. Upgrade to the Kubernetes client that is included with Red Hat build of Quarkus 링크 복사링크가 클립보드에 복사되었습니다!
The Kubernetes Client has been upgraded from 5.12 to 6.7.2. For more information, see the Kubernetes Client - Migration from 5.x to 6.x guide.
1.2.1.2. Improved logic for generating TLS-based container ports 링크 복사링크가 클립보드에 복사되었습니다!
Red Hat build of Quarkus 3.2 introduces changes in how the Kubernetes extension generates TLS-based container ports.
Earlier versions automatically added a container port named https to generated deployment resources. This approach posed problems, especially when SSL/TLS was not configured, rendering the port non-functional.
In 3.2 and later, the Kubernetes extension does not add a container port named https by default. The container port is only added if you take the following steps:
-
You specify any relevant
quarkus.http.ssl.*properties in yourapplication.propertiesfile. -
You set
quarkus.kubernetes.ports.https.tls=truein yourapplication.propertiesfile.
1.2.1.3. Removal of some Kubernetes and OpenShift properties 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, some previously deprecated Kubernetes and OpenShift-related properties have been removed. Replace them with their new counterparts.
| Removed property | New property |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Additionally, with this release, properties without the quarkus. prefix are ignored. For example, before this release, if you added a kubernetes.name property, it was mapped to quarkus.kubernetes.name. To avoid exceptions like java.lang.ClassCastException when upgrading from 2.16.0.Final to 2.16.1.Final #30850, this kind of mapping is no longer done.
As you continue your work with Kubernetes and OpenShift in the context of Quarkus, use the new properties and include the quarkus. prefix where needed.
1.2.2. Core 링크 복사링크가 클립보드에 복사되었습니다!
1.2.2.1. Upgrade to Jandex 3 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, Jandex becomes part of the SmallRye project, consolidating all Jandex projects into a single repository: https://github.com/smallrye/jandex/. Consequently, a new release of the Jandex Maven plugin is delivered alongside the Jandex core.
This release also changes the Maven coordinates. Replace the old coordinates with the new ones.
| Old coordinates | New coordinates |
|
|
|
|
|
|
If you use the Maven Enforcer plugin, configure it to ban any dependencies on org.jboss:jandex. An equivalent plugin is available for Gradle users.
1.2.2.2. Migration path for users of Jandex API 링크 복사링크가 클립보드에 복사되었습니다!
Jandex 3 contains many interesting features and improvements. These changes, unfortunately, required a few breaking changes. Here is the recommended migration path:
-
Upgrade to Jandex 2.4.3.Final. This version provides replacements for some methods that have changed in Jandex 3.0.0. For instance, instead of
ClassInfo.annotations(), useannotationsMap(), and replaceMethodInfo.parameters()withparameterTypes(). Stop using any methods that Jandex has marked as deprecated. -
Ensure you do not use the return value of
Indexer.index()orindexClass(). -
If you compile your code against Jandex 2.4.3.Final, it can run against both 2.4.3.Final and 3.0.0. However, there are exceptions to this. If you implement the
IndexViewinterface or, in some cases, rely on theUnresolvedTypeVariableclass, it is not possible to keep the project compatible with both Jandex 2.4.3 and Jandex 3. -
Upgrade to Jandex 3.0.0. If you implement the
IndexViewinterface, ensure you implement the methods that have been added. And if you extensively use the JandexTypehierarchy, verify if you need to handleTypeVariableReference, which is now used to represent recursive type variables.
Alongside this release, Jandex introduces a new documentation site. While it’s a work in progress, it will become more comprehensive over time. You can also refer to the improved Jandex Javadoc for further information.
1.2.2.3. Removal of io.quarkus.arc.config.ConfigProperties annotation 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the previously deprecated io.quarkus.arc.config.ConfigProperties annotation has been removed.
Instead, use the io.smallrye.config.ConfigMapping annotation to inject multiple related configuration properties.
For more information, see the @ConfigMapping section of the "Mapping configuration to objects" guide.
With this 3.2 release, declaring an interceptor binding annotation on a private method is not supported and triggers a build failure; for example:
jakarta.enterprise.inject.spi.DeploymentException: @Transactional does not affect method com.acme.MyBean.myMethod() because the method is private. [...]
jakarta.enterprise.inject.spi.DeploymentException: @Transactional does not affect method com.acme.MyBean.myMethod() because the method is private. [...]
In earlier releases, declaring an interceptor binding annotation on a private method triggered only a warning in logs but was otherwise ignored.
This support change aims to prevent unintentional usage of interceptor annotations on private methods because they do not have any effect and can cause confusion.
To address this change, remove such annotations from private methods. If removing these annotations is not feasible, you can set the configuration property quarkus.arc.fail-on-intercepted-private-method to false. This setting reverts the system to its previous behavior, where only a warning is logged.
1.2.2.5. Removal of the @AlternativePriority annotation 링크 복사링크가 클립보드에 복사되었습니다!
This release removes the previously deprecated @AlternativePriority annotation. Replace it with both the @Alternative and @Priority annotations.
Example: Removed annotation
@AlternativePriority(1)
@AlternativePriority(1)
Example: Replacement annotations
@Alternative @Priority(1)
@Alternative
@Priority(1)
Use jakarta.annotation.Priority with the @Priority annotation instead of io.quarkus.arc.Priority, which is deprecated and planned for removal in a future release. Both annotations perform identical functions.
1.2.2.6. Testing changes: Fixation of the Mockito subclass mockmaker 링크 복사링크가 클립보드에 복사되었습니다!
This release updates Mockito version 5.x. Notably, Mockito switched the default mockmaker to inline in its 5.0.0 release.
However, to preserve the mocking behavior Quarkus users are familiar with since Quarkus 1.x, and to prevent memory leaks for extensive test suites, Quarkus 3.0 fixes the mockmaker to subclass instead of inline until the latter is fully supported.
If you want to force the inline mockmaker, follow these steps:
Add the following exclusion to your
pom.xml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Add
mockito-coreto your dependencies. -
Mockito 5.3 removed the
mockito-inlineartifact: you can remove it from your dependencies.
1.2.2.7. Update to the minimum supported Maven version 링크 복사링크가 클립보드에 복사되었습니다!
Quarkus has undergone a refactoring of its Maven plugins to support Maven 3.9. As a result, the minimum Maven version supported by Quarkus has been raised from 3.6.2 to 3.8.6 or later. Ensure your development environment is updated accordingly to benefit from the latest improvements and features.
1.2.2.8. Removal of quarkus-bootstrap-maven-plugin 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the previously-deprecated io.quarkus:quarkus-bootstrap-maven-plugin Maven plugin has been removed.
This plugin is for Quarkus extension development only. Therefore, if you are developing custom Quarkus extensions, you must change the artifact ID from io.quarkus:quarkus-bootstrap-maven-plugin to io.quarkus:quarkus-extension-maven-plugin.
This change relates specifically to custom extension development. For standard application development, you use the quarkus-maven-plugin plugin.
1.2.2.9. Mutiny 2 moves to Java Flow 링크 복사링크가 클립보드에 복사되었습니다!
Mutiny is a reactive programming library, the versions 1.x of which were based on the org.reactivestream interfaces, whereas version 2 is based on java.util.concurrent.Flow. These APIs are identical, but the package name has changed.
Mutiny offers adapters to bridge between Mutiny 2 (Flow API) and other libraries with legacy reactive streams API.
1.2.3. Data 링크 복사링크가 클립보드에 복사되었습니다!
1.2.3.1. Removal of Hibernate ORM with Panache methods 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the following previously deprecated methods from Hibernate ORM with Panache and Hibernate ORM with Panache in Kotlin have been removed:
-
io.quarkus.hibernate.orm.panache.PanacheRepositoryBase#getEntityManager(Class<?> clazz) -
io.quarkus.hibernate.orm.panache.kotlin.PanacheRepositoryBase#getEntityManager(clazz: KClass<Any>)
Instead, use the Panache.getEntityManager(Class<?> clazz) method.
1.2.3.2. Enhancement in Hibernate ORM: Automated IN clause parameter padding 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the Hibernate Object-Relational Mapping (ORM) extension has been changed to incorporate automatic IN clause parameter padding as a default setting. This improvement augments the caching efficiency for queries that incorporate IN clauses.
To revert to the previous functionality and deactivate this feature, you can set the property value of quarkus.hibernate-orm.query.in-clause-parameter-padding to false.
1.2.3.3. New dependency: Hibernate Reactive 2 and Hibernate ORM 6.2 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, Quarkus depends on the Hibernate Reactive 2 extension instead of Hibernate Reactive 1. This change implies several changes in behavior and database schema expectations that are incompatible with earlier versions.
Most of the changes are related to Hibernate Reactive 2 depending on Hibernate ORM 6.2 instead of Hibernate ORM 5.6.
The Hibernate Reactive 2 extension is available as a Technology Preview in Red Hat build of Quarkus 3.2.
For more information, see the following resources:
1.2.3.4. Hibernate Search changes 링크 복사링크가 클립보드에 복사되었습니다!
Changes in the defaults for projectable and sortable on GeoPoint fields
With this 3.2 release, Hibernate Search 6.2 changes how defaults are handled for GeoPoint fields.
Suppose your Hibernate Search mapping includes GeoPoint fields that use the default value for the projectable option and either the default value or Sortable.NO for the sortable option. In that case, Elasticsearch schema validation fails on startup because of missing doc values on those fields.
To prevent that failure, complete either of the following steps:
-
Revert to the previous defaults by adding
projectable = Projectable.NOto the mapping annotation of relevantGeoPointfields. -
Recreate your Elasticsearch indexes and reindex your database. The easiest way to do so is to use the
MassIndexerwithdropAndCreateSchemaOnStart(true).
For more information, see the Data format and schema changes section of the "Hibernate Search 6.2.1.Final: Migration Guide from 6.1".
Deprecated or renamed configuration properties
With this 3.2 release, the quarkus.hibernate-search-orm.automatic-indexing.synchronization.strategy property is deprecated and is planned for removal in a future version. Use the quarkus.hibernate-search-orm.indexing.plan.synchronization.strategy property instead.
Also, the quarkus.hibernate-search-orm.automatic-indexing.enable-dirty-check property is deprecated and is planned for removal in a future version. There is no alternative to replace it. After the removal, it is planned that Search will always trigger reindexing after a transaction modifies an object’s field. That is, if a transaction makes the fields "dirty."
For more information, see the Configuration changes section of the "Hibernate Search 6.2.1.Final: Migration Guide from 6.1".
With this 3.2 release, Quarkus doesn’t support the manual creation of ValidatorFactory instances. Instead, you must use the Validation.buildDefaultValidatorFactory() method, which returns ValidatorFactory instances managed by Quarkus that you inject through Context and Dependency Injection (CDI). The main reason for this change is that a ValidatorFactory must be carefully crafted to work in native executables. Before this release, you could still manually create a ValidatorFactory instance and handle it yourself if you could make it work. This change aims to improve the compatibility with components creating their own ValidatorFactory.
For more information, see the following resources:
- Hibernate Validator extension and CDI section of the "Validation with Hibernate Validator" guide.
- ValidatorFactory and native executables section of the "Validation with Hibernate Validator" guide.
- Obtaining a Validator instance of the "Hibernate Validator 8.0.0.Final - Jakarta Bean Validation Reference Implementation: Reference Guide."
1.2.3.6. Quartz jobs class name change 링크 복사링크가 클립보드에 복사되었습니다!
If you are storing jobs for the Quartz extension in a database by using Java Database Connectivity (JDBC), run the following query to update the job class name in your JOB_DETAILS table:
UPDATE JOB_DETAILS SET JOB_CLASS_NAME = 'io.quarkus.quartz.runtime.QuartzSchedulerImpl$InvokerJob' WHERE JOB_CLASS_NAME = 'io.quarkus.quartz.runtime.QuartzScheduler$InvokerJob';
UPDATE JOB_DETAILS SET JOB_CLASS_NAME = 'io.quarkus.quartz.runtime.QuartzSchedulerImpl$InvokerJob' WHERE JOB_CLASS_NAME = 'io.quarkus.quartz.runtime.QuartzScheduler$InvokerJob';
1.2.3.7. Deprecation of QuarkusTransaction.run and QuarkusTransaction.call methods 링크 복사링크가 클립보드에 복사되었습니다!
The QuarkusTransaction.run and QuarkusTransaction.call methods have been deprecated in favor of new, more explicit methods.
Update code that relies on these deprecated methods as follows:
Before
QuarkusTransaction.run(() -> { ... });
QuarkusTransaction.call(() -> { ... });
QuarkusTransaction.run(() -> { ... });
QuarkusTransaction.call(() -> { ... });
After
QuarkusTransaction.requiringNew().run(() -> { ... });
QuarkusTransaction.requiringNew().call(() -> { ... });
QuarkusTransaction.requiringNew().run(() -> { ... });
QuarkusTransaction.requiringNew().call(() -> { ... });
Before
After
QuarkusTransaction.joiningExisting().run(() -> { ... });
QuarkusTransaction.joiningExisting().call(() -> { ... });
QuarkusTransaction.joiningExisting().run(() -> { ... });
QuarkusTransaction.joiningExisting().call(() -> { ... });
Before
After
For more information, see the Programmatic Approach section of the "Using transactions in Quarkus" guide.
1.2.3.8. Renamed Narayana transaction manager property 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the quarkus.transaction-manager.object-store-directory configuration property is renamed to quarkus.transaction-manager.object-store.directory. Update your configuration by replacing the old property name with the new one.
1.2.4. Messaging 링크 복사링크가 클립보드에 복사되었습니다!
1.2.4.1. Removal of vertx-kafka-client dependency from SmallRye Reactive Messaging 링크 복사링크가 클립보드에 복사되었습니다!
This release removes the previously deprecated vertx-kafka-client dependency for the smallrye-reactive-messaging-kafka extension. Although it wasn’t used for client implementations, vertx-kafka-client provided default Kafka Serialization and Deserialization (SerDes) for io.vertx.core.buffer.Buffer, io.vertx.core.json.JsonObject, and io.vertx.core.json.JsonArray types from the io.vertx.kafka.client.serialization package.
If you require this dependency, you can get SerDes for the mentioned types from the io.quarkus.kafka.client.serialization package.
1.2.5. Native 링크 복사링크가 클립보드에 복사되었습니다!
1.2.5.1. Native compilation - Native executables and .so files 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, changes in GraalVM/Mandrel affect the use of extensions reliant on .so files, such as the Java Abstract Window Toolkit (AWT) extension.
When using these extensions, you must add or copy the corresponding .so files to the native container; for example:
COPY --chown=1001:root target/*.so /work/ COPY --chown=1001:root target/*-runner /work/application
COPY --chown=1001:root target/*.so /work/
COPY --chown=1001:root target/*-runner /work/application
In this context, the AWT extension provides headless server-side image processing capabilities, not GUI capabilities.
1.2.5.2. Native Compilation - Work around missing CPU features 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, if you build native executables on recent machines and run them on older machines, you might encounter the following failure when starting the application:
The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA]. Please rebuild the executable with an appropriate setting of the -march option.
The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA].
Please rebuild the executable with an appropriate setting of the -march option.
This error message means that the native compilation used more advanced instruction sets that are unsupported by the CPU running the application. To work around that issue, add the following line to the application.properties file:
quarkus.native.additional-build-args=-march=compatibility
quarkus.native.additional-build-args=-march=compatibility
Then, rebuild your native executable. This setting forces the native compilation to use an older instruction set, increasing the chance of compatibility but decreasing optimization.
To explicitly define the target architecture, run native-image -march=list to get a list of supported configurations. Then, specify a target architecture; for example:
quarkus.native.additional-build-args=-march=x86-64-v4
quarkus.native.additional-build-args=-march=x86-64-v4
If you are experiencing this problem with older AMD64 hosts, try -march=x86-64-v2 before using -march=compatibility.
The GraalVM documentation for Native Image Build Options states that "[the -march parameter generates] instructions for a specific machine type. [This parameter] defaults to x86-64-v3 on AMD64 and armv8-a on AArch64. Use -march=compatibility for best compatibility, or -march=native for best performance if a native executable is deployed on the same machine or on a machine with the same CPU features. To list all available machine types, use -march=list."
The -march parameter is available only in GraalVM 23 and later.
1.2.5.3. Testing changes: Removal of some annotations 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the previously deprecated @io.quarkus.test.junit.NativeImageTest and @io.quarkus.test.junit.DisabledOnNativeImageTest annotations have been rimage::images/ref_changes-that-affect-backward-compatibility-88d2f.png[]. Replace them with their new counterparts.
| Removed annotations | New annotations |
|---|---|
|
|
|
|
|
|
The replacement annotations are functionally equivalent to the removed ones.
1.2.6. Observability 링크 복사링크가 클립보드에 복사되었습니다!
1.2.6.1. Deprecated OpenTracing driver is replaced by OpenTelemetry 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, support for the OpenTracing driver has been deprecated. Removal of the OpenTracing driver is planned for a future Quarkus release.
With this 3.2 release, the SmallRye GraphQL extension has replaced its OpenTracing integration with OpenTelemetry. As a result, when using OpenTracing, the extension no longer generates spans for GraphQL operations.
Also, with this release, the quarkus.smallrye-graphql.tracing.enabled configuration property is obsolete and has been removed. Instead, the SmallRye GraphQL extension automatically produces spans when the OpenTelemetry extension is present.
Update your Quarkus applications to use OpenTelemetry so that they remain compatible with future Quarkus releases.
1.2.6.2. Default metrics format in Micrometer now aligned with Prometheus 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the Micrometer extension exports metrics in the application/openmetrics-text format by default, in line with the Prometheus standard. This change helps make your data easier to read and interpret.
To you get metrics in the earlier format, you can change the Accept request header to text/plain. For example, with the `curl command:
curl -H "Accept: text/plain" localhost:8080/q/metrics/
curl -H "Accept: text/plain" localhost:8080/q/metrics/
1.2.7. Security 링크 복사링크가 클립보드에 복사되었습니다!
1.2.7.1. Removal of CORS filter default support for using a wildcard as an origin 링크 복사링크가 클립보드에 복사되었습니다!
The default behavior of the cross-origin resource sharing (CORS) filter has significantly changed. In earlier releases, when the CORS filter was enabled, it supported all origins by default. With this 3.2 release, support for all origins is no longer enabled by default. Now, if you want to permit all origins, you must explicitly configure it to do so.
After a thorough evaluation, if you determine that all origins require support, configure the system in the following manner:
quarkus.http.cors=true quarkus.http.cors.origins=/.*/
quarkus.http.cors=true
quarkus.http.cors.origins=/.*/
Same-origin requests receive support without needing the quarkus.http.cors.origins configuration. Therefore, adjusting the quarkus.http.cors.origins becomes essential only when you allow trusted third-party origin requests. In such situations, enabling all origins might pose unnecessary risks.
Use this setting with caution to maintain optimal system security.
1.2.7.2. OpenAPI CORS support change 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, OpenAPI has changed its cross-origin resource sharing (CORS) settings and no longer enables wildcard (*) origin support by default. This change helps to prevent potential leakage of OpenAPI documents, enhancing the overall security of your applications.
Although you can enable wildcard origin support in dev mode, it is crucial to consider the potential security implications. Avoid enabling all origins in a production environment because it exposes your applications to security threats. Ensure your CORS settings align with your production environment’s recommended security best practices.
1.2.7.3. Encryption of OIDC session cookie by default 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the OpenID Connect (OIDC) session cookie, created after the completion of an OIDC Authorization Code Flow, is encrypted by default. In most scenarios, you are unlikely to notice this change.
However, if the mTLS or private_key_jwt authentication methods - where the OIDC client private key signs a JSON Web Token (JWT) - are used between Quarkus and the OIDC Provider, an in-memory encryption key gets generated. This key generation can result in some pods failing to decrypt the session cookie, especially in applications dealing with many requests. This situation can arise when a pod attempting to decrypt the cookie isn’t the one that encrypted it.
If such issues occur, register an encryption secret of 32 characters; for example:
quarkus.oidc.token-state-manager.encryption-secret=eUk1p7UB3nFiXZGUXi0uph1Y9p34YhBU
quarkus.oidc.token-state-manager.encryption-secret=eUk1p7UB3nFiXZGUXi0uph1Y9p34YhBU
An encrypted session cookie can exceed 4096-bytes, which can cause some browsers to ignore it. If this occurs, try one or more of the following steps:
-
Set
quarkus.oidc.token-state-manager.split-tokens=trueto store ID, access, and refresh tokens in separate cookies. -
Set
quarkus.oidc.token-state-manager.strategy=id-refresh-tokensif there’s no need to use the access token as a source of roles to requestUserInfoor propagate it to downstream services. -
Register a custom
quarkus.oidc.TokenStateManagerContext and Dependency Injection (CDI) bean with the alternative priority set to1.
If application users access the Quarkus application from within a trusted network, disable the session cookie encryption by applying the following configuration:
quarkus.oidc.token-state-manager.encryption-required=false
quarkus.oidc.token-state-manager.encryption-required=false
1.2.7.4. Default SameSite attribute set to Lax for OIDC session cookie 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, for the Quarkus OpenID Connect (OIDC) extension, the session cookie SameSite attribute is set to Lax by default.
In some earlier releases of Quarkus, the OIDC session cookie SameSite attribute was set to Strict by default. This setting introduced unpredictability in how different browsers handled the session cookie.
1.2.7.5. The OIDC ID token audience claim is verified by default 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the OpenID Connect (OIDC) ID token aud (audience) claim is verified by default. This claim must equal the value of the configured quarkus.oidc.client-id property, as required by the OIDC specification.
To override the expected ID token audience value, set the quarkus.oidc.token.audience configuration property. If you deal with a noncompliant OIDC provider that does not set an ID token aud claim, you can set quarkus.oidc.token.audience to any.
Setting quarkus.oidc.token.audience to any reduces the security of your 3.2 application.
1.2.7.6. Removal of default password for the JWT key and keystore 링크 복사링크가 클립보드에 복사되었습니다!
Before this release, Quarkus used password as the default password for the JSON Web Token (JWT) key and keystore. With this 3.2 release, this default value has been removed.
If you are still using the default password, set a new value to replace password for the following properties in the application.properties file:
quarkus.oidc-client.credentials.jwt.key-store-password=password quarkus.oidc-client.credentials.jwt.key-password=password
quarkus.oidc-client.credentials.jwt.key-store-password=password
quarkus.oidc-client.credentials.jwt.key-password=password
1.2.8. Web 링크 복사링크가 클립보드에 복사되었습니다!
1.2.8.1. Changes to RESTEasy Reactive multipart 링크 복사링크가 클립보드에 복사되었습니다!
With this 3.2 release, the following changes impact multipart support in RESTEasy Reactive:
-
Before this release, you could catch all file uploads regardless of the parameter name using the syntax:
@RestForm List<FileUpload> all, but this was ambiguous and not intuitive. Now, this form only fetches parameters namedall, just like for every other form element of other types, and you must use the following form to catch every parameter regardless of its name:@RestForm(FileUpload.ALL) List<FileUpload> all. -
Multipart form parameter support has been added to
@BeanParam. The@MultipartFormannotation is now deprecated. Use@BeanParaminstead of@MultipartForm. -
The
@BeanParamis now optional and implicit for any non-annotated method parameter with fields annotated with any@Rest*or@*Paramannotations. -
Multipart elements are no longer limited to being encapsulated inside
@MultipartForm-annotated classes: they can be used as method endpoint parameters and endpoint class fields. -
Multipart elements now default to the
@PartType(MediaType.TEXT_PLAIN)MIME type unless they are of typeFileUpload,Path,File,byte[], orInputStream. -
Multipart elements of the
MediaType.TEXT_PLAINMIME type are now deserialized using the regularParamConverterinfrastructure. Before this release, deserialization usedMessageBodyReader. -
Multipart elements of the
FileUpload,Path,File,byte[], orInputStreamtypes are special-cased and deserialized by the RESTEasy Reactive extension, not by theMessageBodyReaderorParamConverterclasses. -
Multipart elements of other explicitly set MIME types still use the appropriate
MessageBodyReaderinfrastructure. -
Multipart elements can now be wrapped in
Listto obtain all values of the part with the same name. -
Any client call that includes the
@RestFormor@FormParamparameters defaults to theMediaType.APPLICATION_FORM_URLENCODEDcontent type unless they are of theFile,Path,Buffer,Multi<Byte>, orbyte[]types, in which case it defaults to theMediaType.MULTIPART_FORM_DATAcontent type.
-
Class
org.jboss.resteasy.reactive.server.core.multipart.MultipartFormDataOutputhas been moved toorg.jboss.resteasy.reactive.server.multipart.MultipartFormDataOutput. -
Class
org.jboss.resteasy.reactive.server.core.multipart.PartItemhas been moved toorg.jboss.resteasy.reactive.server.multipart.PartItem. -
Class
org.jboss.resteasy.reactive.server.core.multipart.FormData.FormValuehas been moved toorg.jboss.resteasy.reactive.server.multipart.FormValue. -
The REST Client no longer uses the server-specific
MessageBodyReaderandMessageBodyWriterclasses associated with Jackson. Before this release, the REST Client unintentionally used those classes. The result is that applications that use bothquarkus-resteasy-reactive-jacksonandquarkus-rest-client-reactiveextensions must now include thequarkus-rest-client-reactive-jacksonextension.
1.2.8.2. Enhanced JAXB extension control 링크 복사링크가 클립보드에 복사되었습니다!
The JAXB extension detects classes that use JAXB annotations and registers them into the default JAXBContext instance. Before this release, any issues or conflicts between the classes and JAXB triggered a JAXB exception at runtime, providing a detailed description to help troubleshoot the problem. However, you could preemptively tackle these conflicts during the build stage.
This release adds a feature that can validate the JAXBContext instance at build time so that you can detect and fix JAXB errors early in the development cycle.
For example, as shown in the following code block, binding both classes to the default JAXBContext instance would inevitably lead to a JAXB exception. This is because the classes share the identical name, Model, despite existing in different packages. This concurrent naming creates a conflict, leading to the exception.
To activate this feature, add the following property:
quarkus.jaxb.validate-jaxb-context=true
quarkus.jaxb.validate-jaxb-context=true
Additionally, this release adds the quarkus.jaxb.exclude-classes property. With this property, you can specify classes to exclude from binding to the JAXBContext. You can provide a comma-separated list of fully qualified class names or a list of packages.
For example, to resolve the conflict in the preceding example, you can exclude one or both of the classes:
quarkus.jaxb.exclude-classes=org.acme.one.Model,org.acme.two.Model
quarkus.jaxb.exclude-classes=org.acme.one.Model,org.acme.two.Model
Or you can exclude all the classes under a package:
quarkus.jaxb.exclude-classes=org.acme.*
quarkus.jaxb.exclude-classes=org.acme.*