|
| 1 | +## Fast-jar as default |
| 2 | + |
| 3 | +Fast-jar is a new Quarkus application packaging format that is faster to boot, compared to our legacy jar packaging. It was introduced several versions ago and it brings many improvements that made us make it the new default. |
| 4 | + |
| 5 | +### Starting the application |
| 6 | + |
| 7 | +The biggest change here is that to start your Quarkus application, you should now use: |
| 8 | + |
| 9 | +```bash |
| 10 | +java -jar target/quarkus-app/quarkus-run.jar |
| 11 | +``` |
| 12 | + |
| 13 | +(instead of using the versioned `-runner` jar) |
| 14 | + |
| 15 | +This change will concern all your applications as soon as you have upgraded them to 1.12. |
| 16 | + |
| 17 | +When deploying your application, make sure to deploy the entire `quarkus-app` directory. |
| 18 | + |
| 19 | +For those who want to stick to the legacy jar packaging, they can go back to the previous behavior by adding the following property to the `application.properties`: |
| 20 | + |
| 21 | +```properties |
| 22 | +quarkus.package.type=legacy-jar |
| 23 | +``` |
| 24 | + |
| 25 | +### Dockerfiles |
| 26 | + |
| 27 | +For existing applications, you have two Dockerfiles: |
| 28 | + |
| 29 | +- `Dockerfile.jvm`: this is the one for the `legacy-jar` packaging |
| 30 | +- `Dockerfile.fast-jar`: this is the one for `fast-jar` packaging (so the new default) |
| 31 | + |
| 32 | +For newly generated applications, the situation is a bit different: |
| 33 | + |
| 34 | +- `Dockerfile.jvm`: this is the one for the `fast-jar` packaging (so the new default) |
| 35 | +- `Dockerfile.legacy-jar`: this is the one for `legacy-jar` |
| 36 | + |
| 37 | +Note that if you want all your applications to be consistent, you can just update the Dockerfiles of your existing applications with the ones of a newly generated project. |
| 38 | + |
| 39 | +You can find an example of the new Fast jar Dockerfile [here](https://github.com/quarkusio/quarkus-quickstarts/blob/master/validation-quickstart/src/main/docker/Dockerfile.jvm). |
| 40 | + |
| 41 | +## Quarkus Maven Plugin |
| 42 | + |
| 43 | +We cleaned up a few things in the Quarkus Maven Plugin. Make sure the `quarkus-maven-plugin` section of the `pom.xml` of your project looks like: |
| 44 | + |
| 45 | +```xml |
| 46 | +<plugin> |
| 47 | + <groupId>io.quarkus</groupId> |
| 48 | + <artifactId>quarkus-maven-plugin</artifactId> |
| 49 | + <version>${quarkus-plugin.version}</version> |
| 50 | + <extensions>true</extensions> |
| 51 | + <executions> |
| 52 | + <execution> |
| 53 | + <goals> |
| 54 | + <goal>build</goal> |
| 55 | + <goal>generate-code</goal> |
| 56 | + <goal>generate-code-tests</goal> |
| 57 | + </goals> |
| 58 | + </execution> |
| 59 | + </executions> |
| 60 | +</plugin> |
| 61 | +``` |
| 62 | + |
| 63 | +## Mutiny |
| 64 | + |
| 65 | +Mutiny has deprecated a few APIs. The deprecated APIs are still available and would work, but are planned for removal. |
| 66 | + |
| 67 | +Changed APIs are: |
| 68 | + |
| 69 | +* `multi.collectItems()` -> `multi.collect()` |
| 70 | +* `multi.groupItems()` -> `multi.group()` |
| 71 | +* `multi.transform().byTakingFirstItems(long)/byTestingItemsWith()/byFilteringItemsWith()` -> `multi.select().first(long)`, `multi.select().when(Function<T, Uni<?>>)`, `multi.select().where(Predicate<T>)` |
| 72 | +* `multi.transform().toHotStream()` -> `multi.toHotStream()` |
| 73 | +* `multi.transform().bySkippingFirstItems(long)` -> `multi.skip().first(long)` |
| 74 | + |
| 75 | +Mutiny removes two methods (deprecated for 11 months): |
| 76 | + |
| 77 | +* `uni.subscribeOn` -> `uni.runSubscriptionOn()` |
| 78 | +* `multi.subscribeOn` -> `multi.runSubscriptionOn()` |
| 79 | + |
| 80 | + |
| 81 | +## Mailer |
| 82 | + |
| 83 | +* The `MailTemplateInstance` now returns a `Uni<Void>` instead of `CompletionStage<Void>`. To convert a `Uni` to a `CompletionStage`, call `.subscribeAsCompletionStage()`. |
| 84 | + |
| 85 | +## Vert.x |
| 86 | + |
| 87 | +* The Axle and RX Java API from Vert.x are no more exposed, use the Mutiny API instead. These features were deprecated since February 2020. |
| 88 | + |
| 89 | +## HTTP |
| 90 | + |
| 91 | +A couple of the default file upload settings have changed. |
| 92 | + |
| 93 | +`quarkus.http.body.delete-uploaded-files-on-end` now defaults to `true` (the reason being that no uploaded files should be left over on the server by default). |
| 94 | +`quarkus.http.body.uploads-directory` now defaults to `${java.io.tmpdir}/uploads` (the reason being that some application might not have the permissions to write to the current working directory) |
| 95 | + |
| 96 | + |
| 97 | +[Path resolution for configurable endpoints](https://quarkus.io/blog/path-resolution-in-quarkus/) changed in this release. |
| 98 | + |
| 99 | +By default, non-application endpoints, like health and metrics, are now grouped under `/q`. |
| 100 | + |
| 101 | +Convenience redirects from previous URLs to new namespaced URLs can be enabled and disabled by setting: |
| 102 | +`quarkus.http.redirect-to-non-application-root-path=false` |
| 103 | + |
| 104 | +Disable the Quarkus non-application endpoints by setting the non-application endpoint root to be the same as the http root: |
| 105 | +`quarkus.http.non-application-root-path=${quarkus.http.root-path}` |
| 106 | + |
| 107 | +You can customize the root used for non-application endpoints by setting `quarkus.http.non-application-root-path` to an alternative path. |
| 108 | + |
| 109 | +As of 1.12.1.Final, leading slashes in configured paths are significant. Please see [Path resolution in Quarkus](https://quarkus.io/blog/path-resolution-in-quarkus/) for more details and examples. |
| 110 | + |
| 111 | +## Rest Client Exceptions |
| 112 | + |
| 113 | +If you are using `quarkus-rest-client` then please be aware that MP REST Client or JAX-RS Client invocation exceptions will no longer have JAX-RS `Response` available by default to avoid leaking some potentially sensitive downstream endpoint data such as cookies. You can set `resteasy.original.webapplicationexception.behavior=true` in `application.properties` if you need to access the exception `Response`. |
| 114 | +Please see https://docs.jboss.org/resteasy/docs/4.5.9.Final/userguide/html/ExceptionHandling.html#ResteasyWebApplicationException for more information. |
| 115 | + |
| 116 | +## Version of distroless image |
| 117 | + |
| 118 | +If you are using the distroless image, please note that it now has an immutable version so you might have to update your Dockerfiles to use: `quay.io/quarkus/quarkus-distroless-image:1.0` instead of `quay.io/quarkus/quarkus-distroless-image:20.3-java11`. |
| 119 | + |
| 120 | + |
| 121 | +## Kafka Health Check |
| 122 | + |
| 123 | +Readiness health checks for _incoming_ Kafka channel may report _DOWN_ if they are consumed lazily (like using SSE). To avoid this, disable the readiness health check: |
| 124 | + |
| 125 | +``` |
| 126 | +mp.messaging.incoming.your-topic.health-readiness-enabled=false |
| 127 | +``` |
0 commit comments