Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.13.6 backports 1 #29798

Merged
merged 23 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8ddf875
Switch native GC policy from space/time to adaptive (default)
galderz Sep 29, 2022
18a3b65
Fix compilation error in virtual threads doc
kdnakt Nov 7, 2022
cd0a7fa
Replace deprecated properties in JReleaser descriptor
gsmet Nov 7, 2022
13be1d9
Correct typos and code style on the Virtual Threads guide
loicmathieu Nov 9, 2022
bda7286
Fix table entries in documentation
mercur3 Nov 7, 2022
af7540b
Doc: Fix statement about CA certs embedding
zakkak Nov 10, 2022
563cd37
Document that Mandrel 22.3 does not provide a -java11 image anymore
cescoffier Nov 7, 2022
5a46562
Demote the "test dir mapping" log message to debug
dimas-b Nov 8, 2022
64c48b6
Fix compilation error in virtual threads doc
kdnakt Nov 13, 2022
3555799
Bump com.gradle.plugin-publish from 1.0.0 to 1.1.0 in /devtools/gradle
dependabot[bot] Nov 11, 2022
faddd68
Fixed code in stork-reference.adoc
hbelmiro Nov 14, 2022
b2f25d9
Set higher timeout for Misc 4 native job
gsmet Nov 16, 2022
66219b0
Fixed error in Stork guide
hbelmiro Nov 11, 2022
335a7fd
update latest brew openjdk package
spolti Nov 11, 2022
6049c28
Create directories when syncing doc branches for website
gsmet Nov 17, 2022
4a421d1
Fix broken markup for a list in security guide
albers Nov 17, 2022
f7977cf
[29307] upgrade narayana to 5.13.1.Final
mmusgrov Nov 16, 2022
2106d86
Rename method names in virtual threads doc
kdnakt Nov 17, 2022
6ce5127
Add HTTPS port configuration in the HTTP reference guide
loicmathieu Nov 19, 2022
dec1489
Fix a typo in the BC CredentialsProvider test
sberyozkin Nov 29, 2022
91f6345
Update the description copied from non-reactive variants
rsvoboda Dec 2, 2022
4452975
Upgrade flapdoodle to 3.5.2
gsmet Nov 22, 2022
38a9211
Include de.flapdoodle.embed in dependabot updates
gsmet Nov 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ updates:
- dependency-name: biz.paluch.logging:logstash-gelf
# MongoDB
- dependency-name: org.mongodb:*
- dependency-name: de.flapdoodle.embed:*
# Avro
- dependency-name: org.apache.avro:*
# gRPC
Expand Down
2 changes: 1 addition & 1 deletion .github/native-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
},
{
"category": "Misc4",
"timeout": 65,
"timeout": 75,
"test-modules": "picocli-native, gradle, micrometer-mp-metrics, micrometer-prometheus, logging-json, jaxp, jaxb, opentelemetry, webjars-locator",
"os-name": "ubuntu-latest"
},
Expand Down
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<hibernate-reactive.version>1.1.8.Final</hibernate-reactive.version>
<hibernate-validator.version>6.2.5.Final</hibernate-validator.version>
<hibernate-search.version>6.1.7.Final</hibernate-search.version>
<narayana.version>5.13.1.Alpha1</narayana.version>
<narayana.version>5.13.1.Final</narayana.version>
<jboss-transaction-api_1.2_spec.version>1.1.1.Final</jboss-transaction-api_1.2_spec.version>
<agroal.version>1.16</agroal.version>
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
Expand Down Expand Up @@ -168,7 +168,7 @@
<okhttp.version>3.14.9</okhttp.version><!-- keep in sync with okio -->
<okio.version>1.17.2</okio.version><!-- keep in sync with okhttp -->
<hibernate-quarkus-local-cache.version>0.1.1</hibernate-quarkus-local-cache.version>
<flapdoodle.mongo.version>3.3.0</flapdoodle.mongo.version>
<flapdoodle.mongo.version>3.5.2</flapdoodle.mongo.version>
<quarkus-spring-api.version>5.2.SP7</quarkus-spring-api.version>
<quarkus-spring-data-api.version>2.1.SP2</quarkus-spring-data-api.version>
<quarkus-spring-security-api.version>5.3.Final</quarkus-spring-security-api.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,6 @@ public NativeImageInvokerInfo build() {
*/
handleAdditionalProperties(nativeImageArgs);

nativeImageArgs.add(
"-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime"); //the default collection policy results in full GC's 50% of the time
nativeImageArgs.add("-H:+AllowFoldMethods");

if (nativeConfig.headless) {
Expand Down
5 changes: 3 additions & 2 deletions devtools/cli/distribution/jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ project:
longDescription: |
Create projects, manage extensions and perform build and development tasks for Quarkus,
the Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM.
website: https://quarkus.io
authors:
- Quarkus Community
license: Apache-2.0
licenseUrl: https://github.com/quarkusio/quarkus/blob/main/LICENSE.txt
copyright: Quarkus contributors
java:
groupId: io.quarkus
Expand All @@ -18,6 +16,9 @@ project:
- cli
- quarkus
- java
links:
homepage: https://quarkus.io
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE.txt

release:
github:
Expand Down
2 changes: 1 addition & 1 deletion devtools/gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.gradle.plugin-publish' version '1.0.0' apply false
id 'com.gradle.plugin-publish' version '1.1.0' apply false
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void beforeTest(Test task) {
project.relativePath(outputDirectoryAsFile)))
.collect(Collectors.joining(","));
task.environment(BootstrapConstants.TEST_TO_MAIN_MAPPINGS, fileList);
project.getLogger().lifecycle("test dir mapping - {}", fileList);
project.getLogger().debug("test dir mapping - {}", fileList);

final String nativeRunner = task.getProject().getBuildDir().toPath().resolve(finalName() + "-runner")
.toAbsolutePath()
Expand Down
11 changes: 9 additions & 2 deletions docs/src/main/asciidoc/building-native-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,15 @@ If you need SSL support in your native executable, you can easily include the ne
Please see xref:native-and-ssl.adoc#working-with-containers[our Using SSL With Native Executables guide] for more information.
====

NOTE: To use Mandrel instead of GraalVM CE, update the `FROM` clause to: `FROM quay.io/quarkus/ubi-quarkus-mandrel:$TAG AS build`.
`$TAG` can be found on the https://quay.io/repository/quarkus/ubi-quarkus-mandrel?tab=tags[Quarkus Mandrel Images Tags page].
[NOTE,subs=attributes+]
====
To use Mandrel instead of GraalVM CE, update the `FROM` clause to: `FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor} AS build`.
====

[NOTE]
====
Starting with 22.3, Mandrel does not provide a `-java11` variant anymore. Use the `-java17` image instead.
====

=== Using a Distroless base image

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/cli-tooling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You can use Homebrew to install (and update) the Quarkus CLI.
Make sure you have a JDK installed before installing the Quarkus CLI.
We haven't added an explicit dependency as we wanted to make sure you could use your preferred JDK version.

You can install a JDK with `brew install openjdk` for Java 17 or `brew install openjdk@11` for Java 11.
You can install a JDK with `brew install openjdk` for the latest Java version, `brew install openjdk@17` for Java 17, or `brew install openjdk@11` for Java 11.
====

To install the Quarkus CLI using Homebrew, run the following command:
Expand Down
6 changes: 6 additions & 0 deletions docs/src/main/asciidoc/http-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ This will also work in tandem with link:https://kubernetes.io/docs/concepts/conf

_Note: in order to remain compatible with earlier versions of Quarkus (before 0.16) the default password is set to "password". It is therefore not a mandatory parameter!_

=== Configure the HTTPS port

By default, Quarkus listens to port 8443 for SSL secured connections and 8444 when running tests.

These ports can be configured in your `application.properties` with the properties `quarkus.http.ssl-port` and `quarkus.http.test-ssl-port`.

=== Disable the HTTP port

It is possible to disable the HTTP port and only support secure requests. This is done via the
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/native-and-ssl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ The easiest way to do so is by setting `quarkus.native.additional-build-args`. F
quarkus.native.additional-build-args=-J-Djavax.net.ssl.trustStore=/tmp/mycerts,-J-Djavax.net.ssl.trustStorePassword=changeit
----

will ensure that the certificates of `/tmp/mycerts` are baked into the native binary and used *in addition* to the default `cacerts`.
will ensure that the certificates of `/tmp/mycerts` are baked into the native binary and used *instead* of the default `cacerts`.
The file containing the custom TrustStore does *not* (and probably should not) have to be present at runtime as its content has been baked into the native binary.

=== Run time configuration
Expand Down
7 changes: 7 additions & 0 deletions docs/src/main/asciidoc/native-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ quarkus.container-image.build=true
quarkus.container-image.group=test
----

[IMPORTANT]
====
Starting with 22.3, Mandrel does not provide a `-java11` version anymore.
Note, however, that this doesn't mean that you may no longer produce native executables with Mandrel for Java 11 projects.
You can still compile your Java 11 projects using OpenJDK 11 and produce native executables from the resulting Java 11 bytecode using the `-java17` Mandrel builder images.
====

== First Debugging Steps

As a first step, change to the project directory and build the native executable for the application:
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/security-getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ The steps in this tutorial guide you through building an application that provid
|===
|Endpoint | Description
|`/api/public`| The `/api/public` endpoint can be accessed anonymously.
|`/api/users/me`|The `/api/admin` endpoint is protected with role-based access control (RBAC), and only users who have been granted the `admin` role can access it.
|`/api/admin`| The `/api/admin` endpoint is protected with role-based access control (RBAC), and only users who have been granted the `admin` role can access it.
At this endpoint, the `@RolesAllowed` annotation is used to declaratively enforce the access constraint.
| `/api/admin`| The `/api/users/me` endpoint is protected with RBAC and only users that have been granted the `user` role can access it. A JSON document with details about the user is returned as a response.
|`/api/users/me`| The `/api/users/me` endpoint is protected with RBAC and only users that have been granted the `user` role can access it. A JSON document with details about the user is returned as a response.
|===

[TIP]
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/asciidoc/security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ For more information about RBAC and other authorization options in Quarkus, see
== Quarkus Security customization

Quarkus Security is highly customizable. You can customize the following core security components of Quarkus:

* `HttpAuthenticationMechanism`
* `IdentityProvider`
* `SecurityidentityAugmentor`
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/stork-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ import io.smallrye.stork.spi.ServiceDiscoveryProvider;
@ServiceDiscoveryAttribute(name = "port",
description = "Port of the service discovery server.", required = false)
public class AcmeServiceDiscoveryProvider // <3>
implements ServiceDiscoveryProvider<AcmeServiceDiscoveryProviderConfiguration> {
implements ServiceDiscoveryProvider<AcmeConfiguration> {

// <4>
@Override
public ServiceDiscovery createServiceDiscovery(AcmeServiceDiscoveryProviderConfiguration config,
public ServiceDiscovery createServiceDiscovery(AcmeConfiguration config,
String serviceName,
ServiceConfig serviceConfig,
StorkInfrastructure storkInfrastructure) {
Expand All @@ -154,7 +154,7 @@ This implementation is straightforward.

<1> `@ServiceDiscoveryType` annotation defines the type of the service discovery provider. For each `ServiceDiscoveryProvider` annotated with this annotation, a configuration class will be generated. The name of the configuration class is constructed by appending `Configuration` to the name of the provider.
<2> Use `@ServiceDiscoveryAttribute` to define configuration properties for services configured with this service discovery provider. Configuration properties are gathered from all properties of a form: `quarkus.stork.my-service.service-discovery.attr=value`.
<3> The provider needs to implement `ServiceDiscoveryType` typed by the configuration class.
<3> The provider needs to implement `ServiceDiscoveryType` typed by the configuration class. This configuration class is generated automatically by the Configuration Generator. Its name is created by appending `Configuration` to the service discovery type, such as `AcmeConfiguration`.
<4> `createServiceDiscovery` method is the factory method. It receives the configuration and access to the name of the service and available infrastructure.

Then, we need to implement the `ServiceDiscovery` interface:
Expand All @@ -177,7 +177,7 @@ public class AcmeServiceDiscovery implements ServiceDiscovery {
private final String host;
private final int port;

public AcmeServiceDiscovery(AcmeServiceDiscoveryProviderConfiguration configuration) {
public AcmeServiceDiscovery(AcmeConfiguration configuration) {
this.host = configuration.getHost();
this.port = Integer.parseInt(configuration.getPort());
}
Expand Down
9 changes: 4 additions & 5 deletions docs/src/main/asciidoc/stork.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ public class Registration {
@ConfigProperty(name = "consul.host") String host;
@ConfigProperty(name = "consul.port") int port;

@ConfigProperty(name = "blue-service-port", defaultValue = "9000") int red;
@ConfigProperty(name = "red-service-port", defaultValue = "9001") int blue;
@ConfigProperty(name = "red-service-port", defaultValue = "9000") int red;
@ConfigProperty(name = "blue-service-port", defaultValue = "9001") int blue;

/**
* Register our two services in Consul.
Expand All @@ -210,11 +210,10 @@ public class Registration {
public void init(@Observes StartupEvent ev, Vertx vertx) {
ConsulClient client = ConsulClient.create(vertx, new ConsulClientOptions().setHost(host).setPort(port));

client.registerServiceAndAwait(
new ServiceOptions().setPort(blue).setAddress("localhost").setName("my-service").setId("blue"));
client.registerServiceAndAwait(
new ServiceOptions().setPort(red).setAddress("localhost").setName("my-service").setId("red"));

client.registerServiceAndAwait(
new ServiceOptions().setPort(blue).setAddress("localhost").setName("my-service").setId("blue"));
}
}
----
Expand Down
39 changes: 19 additions & 20 deletions docs/src/main/asciidoc/virtual-threads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -232,34 +232,34 @@ public class FortuneResource {
var fortunes = repository.findAllBlocking();

// we get the list of quotes
var quotes = getQuotes(fortunes.size()).await().indefinitely();
var quotes = getQuotesAsync(fortunes.size()).await().indefinitely();

// we append each quote to each fortune
for(int i=0; i < fortunes.size();i ++){
fortunes.get(i).title+= " - "+quotes.get(i);
for(int i=0; i < fortunes.size(); i ++){
fortunes.get(i).title += " - " + quotes.get(i);
}
return todos;
return fortunes;
}

@GET
@Path("/quoted-reactive")
public Uni<List<Fortune>> getAllQuoted() {
public Uni<List<Fortune>> getAllQuotedReactive() {
// we first fetch the list of resource and we memoize it
// to avoid fetching it again everytime need it
var fortunes = repository.findAllAsync().memoize().indefinitely();

// once we get a result for fortunes,
// we know its size and can thus query the right number of quotes
var quotes = fortunes.onItem().transformToUni(list -> getQuotes(list.size()));
var quotes = fortunes.onItem().transformToUni(list -> getQuotesAsync(list.size()));

// we now need to combine the two reactive streams
// before returning the result to the user
return Uni.combine().all().unis(fortunes,quotes).asTuple().onItem().transform(tuple -> {
var todoList=tuple.getItem1();
return Uni.combine().all().unis(fortunes, quotes).asTuple().onItem().transform(tuple -> {
var todoList = tuple.getItem1();
//can await it since it is already resolved
var quotesList = tuple.getItem2();
for(int i=0; i < todoList.size();i ++){
todoList.get(i).title+= " - "+quotesList.get(i);
for(int i=0; i < todoList.size(); i ++){
todoList.get(i).title += " - " + quotesList.get(i);
}
return todoList;
});
Expand All @@ -268,20 +268,19 @@ public class FortuneResource {
@GET
@RunOnVirtualThread
@Path("/quoted-virtual-thread")
public List<Fortune> getAllQuotedBlocking() {
public List<Fortune> getAllQuotedVirtualThread() {
//we get the list of fortunes
var fortunes = repository.findAllAsyncAndAwait();

//we get the list of quotes
var quotes = getQuotes(fortunes.size()).await().indefinitely();
var quotes = getQuotesAsync(fortunes.size()).await().indefinitely();

//we append each quote to each fortune
for(int i=0; i < fortunes.size();i ++){
fortunes.get(i).title+= " - "+quotes.get(i);
for(int i=0; i < fortunes.size(); i ++){
fortunes.get(i).title += " - " + quotes.get(i);
}
return todos;
return fortunes;
}

}
----

Expand All @@ -292,7 +291,7 @@ In this situation, the platform thread is blocked exactly as it would have been

According to link:{vthreadjep}[JEP 425] this can happen in two situations:

- when a virtual thread executes performs a blocking operation inside a `synchronized` block or method
- when a virtual thread performs a blocking operation inside a `synchronized` block or method
- when it executes a blocking operation inside a native method or a foreign function

It can be fairly easy to avoid these situations in our own code, but it is hard to verify every dependency we use.
Expand Down Expand Up @@ -413,7 +412,7 @@ reactive implementation.
== A point about performance

Our experiments seem to indicate that Quarkus with virtual threads will scale better than Quarkus blocking (offloading
the computation on a pool of platform worker threads) but not as well Quarkus reactive.
the computation on a pool of platform worker threads) but not as well as Quarkus reactive.
The memory consumption especially might be an issue: if your system needs to keep its memory footprint low we would
advise you stick to using reactive constructs.

Expand All @@ -423,7 +422,7 @@ This was illustrated in the issue that we will now describe.

=== The Netty problem
For JSON serialization, Netty uses their custom implementation of thread locals, `FastThreadLocal` to store buffers.
When using virtual threads in quarkus, then number of virtual threads simultaneously living in the service is directly
When using virtual threads in quarkus, the number of virtual threads simultaneously living in the service is directly
related to the incoming traffic.
It is possible to get hundreds of thousands, if not millions, of them.

Expand Down Expand Up @@ -494,7 +493,7 @@ Instead, you want to specify them all in the configuration of the `quarkus-maven
</plugin>
----

If you don't want to put specify the opening the `java.lang` module in your pom.xml file, you can also specify it as an argument
If you don't want to specify the opening of the `java.lang` module in your pom.xml file, you can also specify it as an argument
when you start the dev mode.

The configuration of the quarkus-maven-plugin will be simpler:
Expand Down
1 change: 1 addition & 0 deletions docs/sync-web-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if [ $BRANCH == "main" ] && [ "$QUARKUS_RELEASE" == "true" ]; then
else
TARGET_GUIDES=${TARGET_DIR}/_versions/${BRANCH}/guides
TARGET_CONFIG=${TARGET_DIR}/_generated-doc/${BRANCH}
mkdir -p ${TARGET_GUIDES}
fi

echo "Copying from target/asciidoc/sources/* to $TARGET_GUIDES"
Expand Down
2 changes: 1 addition & 1 deletion extensions/keycloak-admin-client-reactive/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>quarkus-keycloak-admin-client-reactive</artifactId>
<name>Quarkus - Keycloak Admin Client - Reactive - Runtime</name>
<description>Administer a Keycloak Instance</description>
<description>Administer a Keycloak Instance using Reactive</description>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>quarkus-hibernate-reactive-rest-data-panache</artifactId>
<name>Quarkus - Hibernate Reactive REST data with Panache - Runtime</name>
<description>Generate JAX-RS resources for your Hibernate Panache entities and repositories</description>
<description>Generate JAX-RS resources for your Hibernate Reactive Panache entities and repositories</description>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class SecretProvider implements CredentialsProvider {
@Override
public Map<String, String> getCredentials(String credentialsProviderName) {
Map<String, String> creds = new HashMap<>();
creds.put("keystore-password", "password");
creds.put("keystore-password", "secret");
creds.put("truststore-password", "password");
return creds;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
quarkus.security.security-providers=BCJSSE

quarkus.http.ssl.certificate.key-store-file=server-keystore.jks
quarkus.http.ssl.certificate.key-store-password-key=key-store-password
quarkus.http.ssl.certificate.key-store-password-key=keystore-password
quarkus.http.ssl.certificate.trust-store-file=server-truststore.jks
quarkus.http.ssl.certificate.trust-store-password-key=truststore-password
quarkus.http.ssl.certificate.credentials-provider=custom
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected void doTestListProviders() {
.setBaseUri(String.format("%s://%s", url.getProtocol(), url.getHost()))
.setPort(url.getPort())
.setKeyStore("client-keystore.jks", "password")
.setTrustStore("client-truststore.jks", "password")
.setTrustStore("client-truststore.jks", "secret")
.build();
RestAssured.given()
.spec(spec)
Expand Down
Binary file not shown.