Skip to content

Migration Guide 3.5

Guillaume Smet edited this page Dec 18, 2023 · 10 revisions

Config

Kubernetes Environment Variables

Environment variables set for Kubernetes-based extensions require configuration names to use upper case names separated by underscores as documented in the Configuration Reference. In previous releases, it was possible to use lowercase dotted names. This was accidental and never intended to work this way.

Config property values injected during static intialization phase

Quarkus collects the config property values injected in CDI beans during the static intialization phase. The collected values are then compared with their runtime initialization counterparts and if a mismatch is detected the application startup fails.

How can it happen? For example, let’s have a CDI bean org.acme.MyBean. MyBean injects a @ConfigProperty of name foo and is initialized during the native build. The config property does not exist during the native build and so the default value bar is used. But later, when the application is started the property is defined with a system property: -Dfoo=baz. This would lead to inconsistent state and unexpected behavior. Therefore, Quarkus would fail in this situation by default.

You can annotate an injected field/parameter with @io.quarkus.runtime.annotations.StaticInitSafe to mark the injected configuration object as safe to be initialized during the static intialization phase.

Qute

A user tag is now executed as an isolated template by default, i.e. without access to the context of the template that calls the tag. If you need to change the default behavior and disable the isolation, just add _isolated=false or _unisolated argument to the call site. For example {#itemDetail item showImage=true _isolated=false /} or {#itemDetail item showImage=true _unisolated /}. See also the discussion for more details.

io.quarkus.qute.ResultNode is now an abstract class (it was an interface). In general, the ResultNode should not be implemented by users but it’s part of the public API.

The Qute API is built on top of java.util.concurrent.CompletionStage. Up to now, any implementation could be used in the API. Since Quarkus 3.5 only the java.util.concurrent.CompletableFuture and the internal io.quarkus.qute.CompletedStage are supported by default. The behavior can be changed with the system property -Dquarkus.qute.unrestricted-completion-stage-support=true.

Hibernate ORM

Database version now gets verified on startup even if relying on defaults

The Hibernate ORM extension for Quarkus now verifies that the database version it connects to at runtime is at least as high as the one configured at build time, even when that configuration is not explicit (i.e. when relying on the defaults that target Quarkus' minimum supported DB versions.

This change was made to make application developers aware they use a version of the database that is no longer considered as supported by Hibernate ORM or Quarkus: in that case, Quarkus will refuse to start with an exception.

This change should only affect a supported database subset and only for older versions:

  • MariaDB older than 10.6

  • MySQL older than 8

  • Oracle Database older than 12

  • Microsoft SQL Server older than 13 (2016)

If the database cannot be upgraded to a supported version, it is still possible to use it, although some features might not work. To continue using an older, unsupported version of a database:

Dev Services

Microsoft SQL Server

The Microsoft SQL Server Dev Services have been upgraded to 2022-latest (and azure-sql-edge:latest for Mx Macs).

You will need to adjust your container-license-acceptance.txt file accordingly.

OpenTelemetry

@AddingSpanAttributes now available

Annotating a method in any CDI aware bean with the io.opentelemetry.instrumentation.annotations.AddingSpanAttributes will not create a new span but will add annotated method parameters to attributes in the current span.

If a method is annotated by mistake with @AddingSpanAttributes and @WithSpan annotations, the @WithSpan annotation will take precedence.

OptaPlanner

The OptaPlanner extensions have been removed from the Quarkus Platform as they were not compatible anymore with the latest Quarkus versions.

We recommend you to migrate to the Timefold Quarkus extensions (available in the tooling and on https://code.quarkus.io/). Timefold is a fork of OptaPlanner.

Clone this wiki locally