From 826e42ab7ad9ca97d662a26870ebaed6fd934176 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Fri, 4 Oct 2024 01:57:36 +0000 Subject: [PATCH 01/16] Sync documentation of main branch --- .../main/config/quarkus-all-config.adoc | 84 +++++++++++++++++++ .../main/config/quarkus-redis-client.adoc | 84 +++++++++++++++++++ .../quarkus-redis-client_quarkus.redis.adoc | 84 +++++++++++++++++++ 3 files changed, 252 insertions(+) diff --git a/_generated-doc/main/config/quarkus-all-config.adoc b/_generated-doc/main/config/quarkus-all-config.adoc index f619169ba6..e43ac87fee 100644 --- a/_generated-doc/main/config/quarkus-all-config.adoc +++ b/_generated-doc/main/config/quarkus-all-config.adoc @@ -64654,6 +64654,48 @@ endif::add-copy-button-to-env-var[] a|`discover`, `static` |`discover` +a| [[quarkus-redis-client_quarkus-redis-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-client-name[`quarkus.redis.client-name`]## + +[.description] +-- +The client name used to identify the connection. + +If the `RedisClientConfig++#++configureClientName()` is enabled, and this property is not set it will attempt to extract the value from the `RedisClientName++#++value()` annotation. + +If the `RedisClientConfig++#++configureClientName()` is enabled, both this property and the `RedisClientName++#++value()` must adhere to the pattern '++[++a-zA-Z0-9++\\++-_.~++]*++'; if not, this may result in an incorrect client name after URI encoding. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-redis-client_quarkus-redis-configure-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-configure-client-name[`quarkus.redis.configure-client-name`]## + +[.description] +-- +Whether it should set the client name while connecting with Redis. + +This is necessary because Redis only accepts `client=my-client-name` query parameter in version 6{plus}. + +This property can be used with `RedisClientConfig++#++clientName()` configuration. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS_CONFIGURE_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS_CONFIGURE_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a| [[quarkus-redis-client_quarkus-redis-tls-configuration-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-tls-configuration-name[`quarkus.redis.tls-configuration-name`]## [.description] @@ -65109,6 +65151,48 @@ endif::add-copy-button-to-env-var[] a|`discover`, `static` |`discover` +a| [[quarkus-redis-client_quarkus-redis-redis-client-name-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-client-name[`quarkus.redis."redis-client-name".client-name`]## + +[.description] +-- +The client name used to identify the connection. + +If the `RedisClientConfig++#++configureClientName()` is enabled, and this property is not set it will attempt to extract the value from the `RedisClientName++#++value()` annotation. + +If the `RedisClientConfig++#++configureClientName()` is enabled, both this property and the `RedisClientName++#++value()` must adhere to the pattern '++[++a-zA-Z0-9++\\++-_.~++]*++'; if not, this may result in an incorrect client name after URI encoding. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-redis-client_quarkus-redis-redis-client-name-configure-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-configure-client-name[`quarkus.redis."redis-client-name".configure-client-name`]## + +[.description] +-- +Whether it should set the client name while connecting with Redis. + +This is necessary because Redis only accepts `client=my-client-name` query parameter in version 6{plus}. + +This property can be used with `RedisClientConfig++#++clientName()` configuration. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CONFIGURE_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CONFIGURE_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a| [[quarkus-redis-client_quarkus-redis-redis-client-name-tls-configuration-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-tls-configuration-name[`quarkus.redis."redis-client-name".tls-configuration-name`]## [.description] diff --git a/_generated-doc/main/config/quarkus-redis-client.adoc b/_generated-doc/main/config/quarkus-redis-client.adoc index dff7f6db32..d53b85541d 100644 --- a/_generated-doc/main/config/quarkus-redis-client.adoc +++ b/_generated-doc/main/config/quarkus-redis-client.adoc @@ -456,6 +456,48 @@ endif::add-copy-button-to-env-var[] a|`discover`, `static` |`discover` +a| [[quarkus-redis-client_quarkus-redis-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-client-name[`quarkus.redis.client-name`]## + +[.description] +-- +The client name used to identify the connection. + +If the `RedisClientConfig++#++configureClientName()` is enabled, and this property is not set it will attempt to extract the value from the `RedisClientName++#++value()` annotation. + +If the `RedisClientConfig++#++configureClientName()` is enabled, both this property and the `RedisClientName++#++value()` must adhere to the pattern '++[++a-zA-Z0-9++\\++-_.~++]*++'; if not, this may result in an incorrect client name after URI encoding. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-redis-client_quarkus-redis-configure-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-configure-client-name[`quarkus.redis.configure-client-name`]## + +[.description] +-- +Whether it should set the client name while connecting with Redis. + +This is necessary because Redis only accepts `client=my-client-name` query parameter in version 6{plus}. + +This property can be used with `RedisClientConfig++#++clientName()` configuration. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS_CONFIGURE_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS_CONFIGURE_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a| [[quarkus-redis-client_quarkus-redis-tls-configuration-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-tls-configuration-name[`quarkus.redis.tls-configuration-name`]## [.description] @@ -911,6 +953,48 @@ endif::add-copy-button-to-env-var[] a|`discover`, `static` |`discover` +a| [[quarkus-redis-client_quarkus-redis-redis-client-name-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-client-name[`quarkus.redis."redis-client-name".client-name`]## + +[.description] +-- +The client name used to identify the connection. + +If the `RedisClientConfig++#++configureClientName()` is enabled, and this property is not set it will attempt to extract the value from the `RedisClientName++#++value()` annotation. + +If the `RedisClientConfig++#++configureClientName()` is enabled, both this property and the `RedisClientName++#++value()` must adhere to the pattern '++[++a-zA-Z0-9++\\++-_.~++]*++'; if not, this may result in an incorrect client name after URI encoding. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-redis-client_quarkus-redis-redis-client-name-configure-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-configure-client-name[`quarkus.redis."redis-client-name".configure-client-name`]## + +[.description] +-- +Whether it should set the client name while connecting with Redis. + +This is necessary because Redis only accepts `client=my-client-name` query parameter in version 6{plus}. + +This property can be used with `RedisClientConfig++#++clientName()` configuration. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CONFIGURE_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CONFIGURE_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a| [[quarkus-redis-client_quarkus-redis-redis-client-name-tls-configuration-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-tls-configuration-name[`quarkus.redis."redis-client-name".tls-configuration-name`]## [.description] diff --git a/_generated-doc/main/config/quarkus-redis-client_quarkus.redis.adoc b/_generated-doc/main/config/quarkus-redis-client_quarkus.redis.adoc index dff7f6db32..d53b85541d 100644 --- a/_generated-doc/main/config/quarkus-redis-client_quarkus.redis.adoc +++ b/_generated-doc/main/config/quarkus-redis-client_quarkus.redis.adoc @@ -456,6 +456,48 @@ endif::add-copy-button-to-env-var[] a|`discover`, `static` |`discover` +a| [[quarkus-redis-client_quarkus-redis-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-client-name[`quarkus.redis.client-name`]## + +[.description] +-- +The client name used to identify the connection. + +If the `RedisClientConfig++#++configureClientName()` is enabled, and this property is not set it will attempt to extract the value from the `RedisClientName++#++value()` annotation. + +If the `RedisClientConfig++#++configureClientName()` is enabled, both this property and the `RedisClientName++#++value()` must adhere to the pattern '++[++a-zA-Z0-9++\\++-_.~++]*++'; if not, this may result in an incorrect client name after URI encoding. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-redis-client_quarkus-redis-configure-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-configure-client-name[`quarkus.redis.configure-client-name`]## + +[.description] +-- +Whether it should set the client name while connecting with Redis. + +This is necessary because Redis only accepts `client=my-client-name` query parameter in version 6{plus}. + +This property can be used with `RedisClientConfig++#++clientName()` configuration. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS_CONFIGURE_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS_CONFIGURE_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a| [[quarkus-redis-client_quarkus-redis-tls-configuration-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-tls-configuration-name[`quarkus.redis.tls-configuration-name`]## [.description] @@ -911,6 +953,48 @@ endif::add-copy-button-to-env-var[] a|`discover`, `static` |`discover` +a| [[quarkus-redis-client_quarkus-redis-redis-client-name-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-client-name[`quarkus.redis."redis-client-name".client-name`]## + +[.description] +-- +The client name used to identify the connection. + +If the `RedisClientConfig++#++configureClientName()` is enabled, and this property is not set it will attempt to extract the value from the `RedisClientName++#++value()` annotation. + +If the `RedisClientConfig++#++configureClientName()` is enabled, both this property and the `RedisClientName++#++value()` must adhere to the pattern '++[++a-zA-Z0-9++\\++-_.~++]*++'; if not, this may result in an incorrect client name after URI encoding. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|string +| + +a| [[quarkus-redis-client_quarkus-redis-redis-client-name-configure-client-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-configure-client-name[`quarkus.redis."redis-client-name".configure-client-name`]## + +[.description] +-- +Whether it should set the client name while connecting with Redis. + +This is necessary because Redis only accepts `client=my-client-name` query parameter in version 6{plus}. + +This property can be used with `RedisClientConfig++#++clientName()` configuration. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CONFIGURE_CLIENT_NAME+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REDIS__REDIS_CLIENT_NAME__CONFIGURE_CLIENT_NAME+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a| [[quarkus-redis-client_quarkus-redis-redis-client-name-tls-configuration-name]] [.property-path]##link:#quarkus-redis-client_quarkus-redis-redis-client-name-tls-configuration-name[`quarkus.redis."redis-client-name".tls-configuration-name`]## [.description] From 71858c9d53ddc0685ee409fe045a9c69f607ac1b Mon Sep 17 00:00:00 2001 From: George Gastaldi <gegastaldi@gmail.com> Date: Fri, 4 Oct 2024 15:18:46 -0300 Subject: [PATCH 02/16] Add @bogedal to the list of contributors (#2131) * Add @bogedal to the list of contributors * Sort 1kcontributor-list.yaml --- _data/1kcontributor-list.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_data/1kcontributor-list.yaml b/_data/1kcontributor-list.yaml index 998f6e23ce..e872d0ed03 100644 --- a/_data/1kcontributor-list.yaml +++ b/_data/1kcontributor-list.yaml @@ -1879,6 +1879,10 @@ links: url: https://github.com/teruik name: Kenji Terui avatar: "https://avatars.githubusercontent.com/u/64245877?u=6e1b9fbcb36ec517fab201880666f4acc1a762c0&v=4" + - login: bogedal + url: https://github.com/bogedal + name: Kenneth BΓΈgedal + avatar: "https://avatars.githubusercontent.com/u/42640385?u=79bf0d6cca6dabe9f805aaff98e15541db325d80&v=4" - login: kdubois url: https://github.com/kdubois name: Kevin Dubois From 1c39d3e085ec117b80d40df6f1247b17a39a76cb Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Fri, 4 Oct 2024 20:02:06 +0000 Subject: [PATCH 03/16] Sync working groups --- _data/wg.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index b22b005f64..16902fa21a 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -1,5 +1,23 @@ --- working-groups: + - title: "Test classloading" + board-url: "https://github.com/orgs/quarkusio/projects/30" + short-description: The goal of this working group is to rewrite Quarkus's test classloading, so that tests are run in the same classloader as the application under tests, and Quarkus extensions can do "Quarkus-y" manipulations of test classes. + readme: | + <p>At the moment, Quarkus tests are invoked using one classloader, and then executed in a different classloader. This mostly works well, but means some use cases don't work: extensions cannot manipulate test classes in the same way that they do normal application classes. For example, anything run via a JUnit @TestTemplate test case will see the un-transformed class.</p> + <p>It also means we have extra user-facing complexity, such as the QuarkusTest*Callbacks](https://quarkus.io/guides/getting-started-testing#enrichment-via-quarkustestcallback):</p> + <blockquote> + <p>While it is possible to use JUnit Jupiter callback interfaces like BeforeEachCallback, you might run into classloading issues because Quarkus has to run tests in a custom classloader which JUnit is not aware of.</p> + </blockquote> + <p>A final benefit is a reduction in the internal complexity of our code. Hopping between classloaders during test execution takes a lot of work, and adds a lot of code! It also is brittle in places. For example, because the hop between classloaders relies on serialization in some cases, it's becoming harder to do as the JVM tightens up security restrictions. We used to rely on xstream, but that stopped working in Java 17. In https://github.com/quarkusio/quarkus/pull/40601, @dmlloyd moved us to use the JBoss Serializer, which works better, but might still be affected by future restrictions on class access.</p> + <p>The goal of this working group is to allow test classes to fully participate in the 'quarkification' of classes. The mechanism for this is probably just to load the test classes with the classloader we intend to run them with, so that JUnit sees the 'correct' version of the class.</p> + status: on track + completed: false + last-activity: 2024-10-04 + last-update: | + Since we don't have a target date, and progress is being made, I can declare this on track, with only a slightly murky conscience. + + This is a big change, and one which doesn't lend itself well to dividing into smaller chunks. I'm keeping a spreadsheet of build results. In the CI runs, the number of failing jobs was 31 at the last update, and it is now 25. A number of suites, such as `integration-tests/devtools` were failing, and are now passing. - title: "Quarkus Config and IDEs" board-url: "https://github.com/orgs/quarkusio/projects/32" short-description: Let's define a format for the files containing the config model we will include in the jars for IDE consumption. @@ -132,24 +150,6 @@ working-groups: last-activity: 2024-09-29 last-update: | Just got started. - - title: "Test classloading" - board-url: "https://github.com/orgs/quarkusio/projects/30" - short-description: The goal of this working group is to rewrite Quarkus's test classloading, so that tests are run in the same classloader as the application under tests, and Quarkus extensions can do "Quarkus-y" manipulations of test classes. - readme: | - <p>At the moment, Quarkus tests are invoked using one classloader, and then executed in a different classloader. This mostly works well, but means some use cases don't work: extensions cannot manipulate test classes in the same way that they do normal application classes. For example, anything run via a JUnit @TestTemplate test case will see the un-transformed class.</p> - <p>It also means we have extra user-facing complexity, such as the QuarkusTest*Callbacks](https://quarkus.io/guides/getting-started-testing#enrichment-via-quarkustestcallback):</p> - <blockquote> - <p>While it is possible to use JUnit Jupiter callback interfaces like BeforeEachCallback, you might run into classloading issues because Quarkus has to run tests in a custom classloader which JUnit is not aware of.</p> - </blockquote> - <p>A final benefit is a reduction in the internal complexity of our code. Hopping between classloaders during test execution takes a lot of work, and adds a lot of code! It also is brittle in places. For example, because the hop between classloaders relies on serialization in some cases, it's becoming harder to do as the JVM tightens up security restrictions. We used to rely on xstream, but that stopped working in Java 17. In https://github.com/quarkusio/quarkus/pull/40601, @dmlloyd moved us to use the JBoss Serializer, which works better, but might still be affected by future restrictions on class access.</p> - <p>The goal of this working group is to allow test classes to fully participate in the 'quarkification' of classes. The mechanism for this is probably just to load the test classes with the classloader we intend to run them with, so that JUnit sees the 'correct' version of the class.</p> - status: on track - completed: false - last-activity: 2024-09-24 - last-update: | - Since we don't have a target date, and progress is being made, I can declare this on track, with only a slightly murky conscience. - - This is a big change, and one which doesn't lend itself well to dividing into smaller chunks. I'm keeping a spreadsheet of build results. In the CI runs, the number of failing jobs was 31 at the last update, and it is now 25. A number of suites, such as `integration-tests/devtools` were failing, and are now passing. - title: "WebSocket Next" board-url: "https://github.com/orgs/quarkusio/projects/26" short-description: WebSocket-Next related tasks From cd36ffec941cd4ba9b2297d1a4ea5dc91309969d Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Sun, 6 Oct 2024 01:57:40 +0000 Subject: [PATCH 04/16] Sync documentation of main branch --- _versions/main/guides/web.adoc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/_versions/main/guides/web.adoc b/_versions/main/guides/web.adoc index dc3cf6f74a..edfffb0162 100644 --- a/_versions/main/guides/web.adoc +++ b/_versions/main/guides/web.adoc @@ -155,6 +155,8 @@ public class Todos extends Controller { } ---- +NOTE: Check out https://www.youtube.com/watch?v=JNmHNSmK180[Quarkus Insights Episode #178]. First part is a hands-on demonstration of creating a CMS with Renarde. You can also give it a try using https://github.com/quarkusio/quarkus-web-lab[the web-lab repo]). + == Single Page Applications Quarkus provides very solid tools for creating or integrating Single Page Applications to Quarkus (React, Angular, Vue, β¦), here are 3 options: @@ -265,8 +267,3 @@ You could also split it in two services: one for the backend and one for the fro If your application involves a substantial number of static resources, consider using a CDN. Both the Web Bundler and Quinoa can be configured to work seamlessly with a CDN, providing improved performance and distribution of assets. // It would be nice to have a blog article and benchmark about this topic. - - - - - From 40a57fbc2f9475e5db287acd1baacfdab7651c1e Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Mon, 7 Oct 2024 15:02:18 +0000 Subject: [PATCH 05/16] Sync working groups --- _data/wg.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index 16902fa21a..7acbf49846 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -15,9 +15,7 @@ working-groups: completed: false last-activity: 2024-10-04 last-update: | - Since we don't have a target date, and progress is being made, I can declare this on track, with only a slightly murky conscience. - - This is a big change, and one which doesn't lend itself well to dividing into smaller chunks. I'm keeping a spreadsheet of build results. In the CI runs, the number of failing jobs was 31 at the last update, and it is now 25. A number of suites, such as `integration-tests/devtools` were failing, and are now passing. + Progress continues. In the CI runs, the number of failing jobs is now 10. Most significantly, a bug which meant almost nothing worked on windows has now been fixed. - title: "Quarkus Config and IDEs" board-url: "https://github.com/orgs/quarkusio/projects/32" short-description: Let's define a format for the files containing the config model we will include in the jars for IDE consumption. From 38ded0e1ecef11b08ea3a315901ac533c55e3286 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Tue, 8 Oct 2024 14:02:15 +0000 Subject: [PATCH 06/16] Sync working groups --- _data/wg.yaml | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index 7acbf49846..a344261a4f 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -1,5 +1,35 @@ --- working-groups: + - title: "Roq :: Quarkus SSG" + board-url: "https://github.com/orgs/quarkiverse/projects/6" + short-description: Allow Static Site Generation with Quarkus. + readme: | + <p>New initiative to allow Static Site Generation with Quarkus.</p> + <p>Quarkus already provides most of the pieces to create great web applications (https://quarkus.io/guides/web).</p> + <p>I recently added https://github.com/quarkiverse/quarkus-roq. It will allow generating a static website out of any Quarkus application (it starts the app, fetch all the configured pages and assets, generate a static website and stop), it already works but it is still very alpha.</p> + <p>What's missing? we now need to incrementally add the toolkit to ease the process of creating static content through Quarkus:</p> + <ul> + <li>Static Data</li> + <li>Markdown/Asciidoc and frontmatter</li> + <li>SEO</li> + <li>Image processing</li> + <li>Easy to configure routing</li> + </ul> + <p>This will allow to develop the content using Quarkus dev-mode, and then generate for Github Pages or similar when it's ready.</p> + <p>Bonus, everything added will benefit any "non-static" Quarkus app and any Static Quarkus app could also become non static.</p> + <p>This effort is now tracked using a "Working Group" project: https://github.com/orgs/quarkiverse/projects/6</p> + <p>This is a great opportunity to participate in fun effort and be involved with the Quarkus community, if anyone is interested in being a part of this, please reach out to me π</p> + status: on track + completed: false + last-activity: 2024-10-08 + last-update: | + 0.0.3 has been released, it is the MVP version and allowed to publish the Roq blog: https://quarkiverse.io/quarkus-roq/posts/2024-08-29-welcome-to-roq/ + + From now on, we start adding features incrementally, documenting. + + The target is to have 1.0.0 the 1 October 2024. + + For 1.0 we need pagination, tags and SEO. - title: "Test classloading" board-url: "https://github.com/orgs/quarkusio/projects/30" short-description: The goal of this working group is to rewrite Quarkus's test classloading, so that tests are run in the same classloader as the application under tests, and Quarkus extensions can do "Quarkus-y" manipulations of test classes. @@ -53,36 +83,6 @@ working-groups: With more features to be added in future pull requests. The pull request is on hold due to some concerns raised by @ia3andy. A meeting has been scheduled to discuss those concerns. - - title: "Roq :: Quarkus SSG" - board-url: "https://github.com/orgs/quarkiverse/projects/6" - short-description: Allow Static Site Generation with Quarkus. - readme: | - <p>New initiative to allow Static Site Generation with Quarkus.</p> - <p>Quarkus already provides most of the pieces to create great web applications (https://quarkus.io/guides/web).</p> - <p>I recently added https://github.com/quarkiverse/quarkus-roq. It will allow generating a static website out of any Quarkus application (it starts the app, fetch all the configured pages and assets, generate a static website and stop), it already works but it is still very alpha.</p> - <p>What's missing? we now need to incrementally add the toolkit to ease the process of creating static content through Quarkus:</p> - <ul> - <li>Static Data</li> - <li>Markdown/Asciidoc and frontmatter</li> - <li>SEO</li> - <li>Image processing</li> - <li>Easy to configure routing</li> - </ul> - <p>This will allow to develop the content using Quarkus dev-mode, and then generate for Github Pages or similar when it's ready.</p> - <p>Bonus, everything added will benefit any "non-static" Quarkus app and any Static Quarkus app could also become non static.</p> - <p>This effort is now tracked using a "Working Group" project: https://github.com/orgs/quarkiverse/projects/6</p> - <p>This is a great opportunity to participate in fun effort and be involved with the Quarkus community, if anyone is interested in being a part of this, please reach out to me π</p> - status: on track - completed: false - last-activity: 2024-10-03 - last-update: | - 0.0.3 has been released, it is the MVP version and allowed to publish the Roq blog: https://quarkiverse.io/quarkus-roq/posts/2024-08-29-welcome-to-roq/ - - From now on, we start adding features incrementally, documenting. - - The target is to have 1.0.0 the 1 October 2024. - - For 1.0 we need pagination, tags and SEO. - title: "Quarkus 3.15 LTS" board-url: "https://github.com/orgs/quarkusio/projects/28" short-description: This WG focuses on defining the issues we would like to have in the next-to-be LTS (Quarkus 3.14/3.15) From 2ed8ef8266a98073a192f38b42975bd1c2678a58 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Wed, 9 Oct 2024 02:04:15 +0000 Subject: [PATCH 07/16] Sync documentation of main branch --- .../main/config/quarkus-all-config.adoc | 23 ++++ .../main/config/quarkus-hibernate-orm.adoc | 23 ++++ ...s-hibernate-orm_quarkus.hibernate-orm.adoc | 23 ++++ _versions/main/guides/cdi-integration.adoc | 67 ++++++++++ _versions/main/guides/hibernate-orm.adoc | 15 ++- _versions/main/guides/qute-reference.adoc | 20 ++- _versions/main/guides/rest-client.adoc | 117 +++++++++++++----- 7 files changed, 249 insertions(+), 39 deletions(-) diff --git a/_generated-doc/main/config/quarkus-all-config.adoc b/_generated-doc/main/config/quarkus-all-config.adoc index e43ac87fee..fd551be049 100644 --- a/_generated-doc/main/config/quarkus-all-config.adoc +++ b/_generated-doc/main/config/quarkus-all-config.adoc @@ -19455,6 +19455,29 @@ endif::add-copy-button-to-env-var[] |string | +a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled[`quarkus.hibernate-orm.database.version-check.enabled`]## + +`quarkus.hibernate-orm."persistence-unit-name".database.version-check.enabled` + +[.description] +-- +Whether Hibernate ORM should check on startup +that the version of the database matches the version configured on the dialect +(either the default version, or the one set through `quarkus.datasource.db-version`). + +This should be set to `false` if the database is not available on startup. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_DATABASE_VERSION_CHECK_ENABLED+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_HIBERNATE_ORM_DATABASE_VERSION_CHECK_ENABLED+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|``true` if the dialect was set automatically by Quarkus, `false` if it was set explicitly` + h|[[quarkus-hibernate-orm_section_quarkus-hibernate-orm-dialect]] [.section-name.section-level0]##link:#quarkus-hibernate-orm_section_quarkus-hibernate-orm-dialect[Dialect related configuration]## h|Type diff --git a/_generated-doc/main/config/quarkus-hibernate-orm.adoc b/_generated-doc/main/config/quarkus-hibernate-orm.adoc index fc2a78359a..729ce70784 100644 --- a/_generated-doc/main/config/quarkus-hibernate-orm.adoc +++ b/_generated-doc/main/config/quarkus-hibernate-orm.adoc @@ -595,6 +595,29 @@ endif::add-copy-button-to-env-var[] |string | +a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled[`quarkus.hibernate-orm.database.version-check.enabled`]## + +`quarkus.hibernate-orm."persistence-unit-name".database.version-check.enabled` + +[.description] +-- +Whether Hibernate ORM should check on startup +that the version of the database matches the version configured on the dialect +(either the default version, or the one set through `quarkus.datasource.db-version`). + +This should be set to `false` if the database is not available on startup. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_DATABASE_VERSION_CHECK_ENABLED+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_HIBERNATE_ORM_DATABASE_VERSION_CHECK_ENABLED+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|``true` if the dialect was set automatically by Quarkus, `false` if it was set explicitly` + h|[[quarkus-hibernate-orm_section_quarkus-hibernate-orm-dialect]] [.section-name.section-level0]##link:#quarkus-hibernate-orm_section_quarkus-hibernate-orm-dialect[Dialect related configuration]## h|Type diff --git a/_generated-doc/main/config/quarkus-hibernate-orm_quarkus.hibernate-orm.adoc b/_generated-doc/main/config/quarkus-hibernate-orm_quarkus.hibernate-orm.adoc index fc2a78359a..729ce70784 100644 --- a/_generated-doc/main/config/quarkus-hibernate-orm_quarkus.hibernate-orm.adoc +++ b/_generated-doc/main/config/quarkus-hibernate-orm_quarkus.hibernate-orm.adoc @@ -595,6 +595,29 @@ endif::add-copy-button-to-env-var[] |string | +a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled[`quarkus.hibernate-orm.database.version-check.enabled`]## + +`quarkus.hibernate-orm."persistence-unit-name".database.version-check.enabled` + +[.description] +-- +Whether Hibernate ORM should check on startup +that the version of the database matches the version configured on the dialect +(either the default version, or the one set through `quarkus.datasource.db-version`). + +This should be set to `false` if the database is not available on startup. + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_DATABASE_VERSION_CHECK_ENABLED+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_HIBERNATE_ORM_DATABASE_VERSION_CHECK_ENABLED+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|``true` if the dialect was set automatically by Quarkus, `false` if it was set explicitly` + h|[[quarkus-hibernate-orm_section_quarkus-hibernate-orm-dialect]] [.section-name.section-level0]##link:#quarkus-hibernate-orm_section_quarkus-hibernate-orm-dialect[Dialect related configuration]## h|Type diff --git a/_versions/main/guides/cdi-integration.adoc b/_versions/main/guides/cdi-integration.adoc index 39920b6516..fe92dd294b 100644 --- a/_versions/main/guides/cdi-integration.adoc +++ b/_versions/main/guides/cdi-integration.adoc @@ -419,6 +419,73 @@ public class TestRecorder { ---- <1> Pass a contextual reference of `Bar` to the constructor of `Foo`. +=== Inactive Synthetic Beans + +In the case when one needs to register multiple synthetic beans at build time but only wants a subset of them active at runtime, it is useful to be able to mark a synthetic bean as _inactive_. +This is done by configuring a "check active" procedure, which should be a `Supplier<ActiveResult>` obtained from a recorder: + +.Inactive Synthetic Bean - Build Step Example +[source,java] +---- +@BuildStep +@Record(RUNTIME_INIT) +SyntheticBeanBuildItem syntheticBean(TestRecorder recorder) { + return SyntheticBeanBuildItem.configure(Foo.class) + .scope(Singleton.class) + .startup() // <1> + .checkActive(recorder.isFooActive()) // <2> + .createWith(recorder.createFoo()) + .done(); +} +---- +<1> A bean that might be inactive is typically initialized eagerly, to make sure that an error is thrown at application startup. + If the bean is in fact inactive, but is not injected into an always-active bean, eager initialization is skipped and no error is thrown. +<2> Configures the "check active" procedure. + +.Inactive Synthetic Bean - Recorder Example +[source,java] +---- +@Recorder +public class TestRecorder { + public Supplier<ActiveResult> isFooActive() { + return () -> { + if (... should not be active ...) { // <1> + return ActiveResult.inactive("explanation"); // <2> + } + return ActiveResult.active(); + }; + } + + public Function<SyntheticCreationalContext<Foo>, Foo> createFoo() { + return (context) -> { + return new Foo(); + }; + } +} +---- +<1> The condition when the synthetic bean should be inactive. +<2> Proper explanation of why the bean is inactive. + Another inactive `ActiveResult` may also be provided as a cause, if this bean's inactivity stems from another bean's inactivity. + +If an inactive bean is injected somewhere, or is dynamically looked up, an `InactiveBeanException` is thrown. +The error message contains the reason (from the `ActiveResult`), the cause chain (also from the `ActiveResult`), and possibly also a list of all injection points that resolve to this bean. + +If you want to handle the inactive case gracefully, you should always inject possibly inactive beans using `Instance<>`. +You also need to check before obtaining the actual instance: + +[source,java] +---- +import io.quarkus.arc.InjectableInstance; + +@Inject +InjectableInstance<Foo> foo; + +if (foo.getHandle().getBean().isActive()) { + Foo foo = foo.get(); + ... +} +---- + [[synthetic_observers]] == Use Case - Synthetic Observers diff --git a/_versions/main/guides/hibernate-orm.adoc b/_versions/main/guides/hibernate-orm.adoc index 47a7abe935..e8d9c7c3f5 100644 --- a/_versions/main/guides/hibernate-orm.adoc +++ b/_versions/main/guides/hibernate-orm.adoc @@ -205,11 +205,20 @@ or implicitly set by the Quarkus build process to a minimum supported version of Quarkus will try to check this preconfigured version against the actual database version on startup, leading to a startup failure when the actual version is lower. -This is because Hibernate ORM may generate SQL that is invalid -for versions of the database older than what is configured, -which would lead to runtime exceptions. +This is a safeguard: for versions of the database older than what is configured, +Hibernate ORM may generate SQL that is invalid which would lead to runtime exceptions. +// TODO disable the check by default when offline startup is opted in +// See https://github.com/quarkusio/quarkus/issues/13522 If the database cannot be reached, a warning will be logged but startup will proceed. +You can optionally disable the version check if you know the database won't be reachable on startup +using <<quarkus-hibernate-orm_quarkus-hibernate-orm-database-version-check-enabled,`quarkus.hibernate-orm.database.version-check.enabled=false`>>. + +// TODO change the default to "always enabled" when we solve version detection problems +// See https://github.com/quarkusio/quarkus/issues/43703 +// See https://github.com/quarkusio/quarkus/issues/42255 +The version check is disabled by default when a dialect is set explicitly, +as a workaround for https://github.com/quarkusio/quarkus/issues/42255[#42255]/link:https://github.com/quarkusio/quarkus/issues/43703[#43703]. ==== [[hibernate-dialect-other-databases]] diff --git a/_versions/main/guides/qute-reference.adoc b/_versions/main/guides/qute-reference.adoc index 5cdeab97b1..68a1586830 100644 --- a/_versions/main/guides/qute-reference.adoc +++ b/_versions/main/guides/qute-reference.adoc @@ -1710,15 +1710,31 @@ A CDI bean annotated with `@Named` can be referenced in any template through `cd NOTE: `@Named @Dependent` beans are shared across all expressions in a template for a single rendering operation, and destroyed after the rendering finished. All expressions with `cdi` and `inject` namespaces are validated during build. - For the expression `cdi:personService.findPerson(10).name`, the implementation class of the injected bean must either declare the `findPerson` method or a matching <<template_extension_methods,template extension method>> must exist. - For the expression `inject:foo.price`, the implementation class of the injected bean must either have the `price` property (e.g. a `getPrice()` method) or a matching <<template_extension_methods,template extension method>> must exist. NOTE: A `ValueResolver` is also generated for all beans annotated with `@Named` so that it's possible to access its properties without reflection. TIP: If your application serves xref:http-reference.adoc[HTTP requests] you can also inject the current `io.vertx.core.http.HttpServerRequest` via the `inject` namespace, e.g. `{inject:vertxRequest.getParam('foo')}`. +Sometimes it may be necessary to access public methods and properties of a CDI bean that is not annotated with `@Named`. +However, if you don't control the source of the bean it is not possible to add the `@Named` annotation. +Nevertheless, it is possible to create an intermediate CDI bean annotated with `@Named`. +This intermediate bean can inject the bean in question and make it accessible. +A Java record is a very convenient way to define such an intermediate CDI bean. + +[source,java] +---- +@Named <1> <2> +public record UserData(UserInfo info, @LoggedIn String username) { <3> +} +---- +<1> If no name is explicitly specified by the `value` member the https://jakarta.ee/specifications/cdi/4.1/jakarta-cdi-spec-4.1#default_name[default name is assigned] - the simple name of the bean class, after converting the first character to lower case. In this particular case, the default name is `userData`. +<2> The `@Singleton` scope is added automatically. +<3> All parameters of the canonical constructor are injection points. The accessor methods can be used to obtain the injected bean. + +And then in a template you can simply use `{cdi:userData.info}` or `{cdi:userData.username}`. + [[typesafe_expressions]] === Type-safe Expressions diff --git a/_versions/main/guides/rest-client.adoc b/_versions/main/guides/rest-client.adoc index 3dd2f1a196..390a623a0d 100644 --- a/_versions/main/guides/rest-client.adoc +++ b/_versions/main/guides/rest-client.adoc @@ -337,6 +337,89 @@ Furthermore, the client can also send arbitrarily large files if one of the foll * `File` * `Path` +=== Getting other response properties + +==== Using RestResponse + +If you need to get more properties of the HTTP response than just the body, such as the status code +or headers, you can make your method return `org.jboss.resteasy.reactive.RestResponse` from a method. +An example of this could look like: + +[source,java] +---- +package org.acme.rest.client; + +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import org.jboss.resteasy.reactive.RestQuery; +import org.jboss.resteasy.reactive.RestResponse; + +import java.util.Set; + +@Path("/extensions") +@RegisterRestClient +public interface ExtensionsService { + + @GET + RestResponse<Set<Extension>> getByIdResponseProperties(@RestQuery String id); +} +---- + +NOTE: You can also use the Jakarta REST type link:{jaxrsapi}/jakarta/ws/rs/core/Response.html[`Response`] but it is +not strongly typed to your entity. + +== Create the Jakarta REST resource + +Create the `src/main/java/org/acme/rest/client/ExtensionsResource.java` file with the following content: + + +[source,java] +---- +package org.acme.rest.client; + +import org.eclipse.microprofile.rest.client.inject.RestClient; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import java.util.Set; + +@Path("/extension") +public class ExtensionsResource { + + @RestClient // <1> + ExtensionsService extensionsService; + + + @GET + @Path("/id/{id}") + public Set<Extension> id(String id) { + return extensionsService.getById(id); + } + + @GET + @Path("/properties") + public RestResponse<Set<Extension>> responseProperties(@RestQuery String id) { + RestResponse<Set<Extension>> clientResponse = extensionsService.getByIdResponseProperties(id); //<2> + String contentType = clientResponse.getHeaderString("Content-Type"); + int status = clientResponse.getStatus(); + String setCookie = clientResponse.getHeaderString("Set-Cookie"); + Date lastModified = clientResponse.getLastModified(); + + Log.infof("content-Type: %s status: %s Last-Modified: %s Set-Cookie: %s", contentType, status, lastModified, + setCookie); + + return RestResponse.fromResponse(clientResponse); + } +} +---- + +There are two interesting parts in this listing: + +<1> the client stub is injected with the `@RestClient` annotation instead of the usual CDI `@Inject` +<2> `org.jboss.resteasy.reactive.RestResponse` used as effective way of getting response properties via RestResponse directly from RestClient, +as described in <<Using RestResponse>> == Create the configuration @@ -411,40 +494,6 @@ quarkus.rest-client.alpn=true quarkus.rest-client.extensions-api.alpn=true ---- -== Create the Jakarta REST resource - -Create the `src/main/java/org/acme/rest/client/ExtensionsResource.java` file with the following content: - - -[source,java] ----- -package org.acme.rest.client; - -import org.eclipse.microprofile.rest.client.inject.RestClient; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import java.util.Set; - -@Path("/extension") -public class ExtensionsResource { - - @RestClient // <1> - ExtensionsService extensionsService; - - - @GET - @Path("/id/{id}") - public Set<Extension> id(String id) { - return extensionsService.getById(id); - } -} ----- - -There are two interesting parts in this listing: - -<1> the client stub is injected with the `@RestClient` annotation instead of the usual CDI `@Inject` - == Programmatic client creation with QuarkusRestClientBuilder Instead of annotating the client with `@RegisterRestClient`, and injecting From 7cea0a879e82ee2fa0fcf084351b85f9d803c45c Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Wed, 9 Oct 2024 15:02:13 +0000 Subject: [PATCH 08/16] Sync working groups --- _data/wg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index a344261a4f..beea9a5a01 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -21,7 +21,7 @@ working-groups: <p>This is a great opportunity to participate in fun effort and be involved with the Quarkus community, if anyone is interested in being a part of this, please reach out to me π</p> status: on track completed: false - last-activity: 2024-10-08 + last-activity: 2024-10-09 last-update: | 0.0.3 has been released, it is the MVP version and allowed to publish the Roq blog: https://quarkiverse.io/quarkus-roq/posts/2024-08-29-welcome-to-roq/ From 3487ad4f9dcbe23e25f43cbd13dca8ef76ea3f0b Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Thu, 10 Oct 2024 01:58:07 +0000 Subject: [PATCH 09/16] Sync documentation of main branch --- .../main/config/quarkus-all-config.adoc | 19 +++++++++++++++++++ .../main/config/quarkus-rest-client.adoc | 19 +++++++++++++++++++ ...arkus-rest-client_quarkus.rest-client.adoc | 19 +++++++++++++++++++ _versions/main/guides/rest-client.adoc | 7 +++++-- _versions/main/guides/resteasy-client.adoc | 4 ++++ 5 files changed, 66 insertions(+), 2 deletions(-) diff --git a/_generated-doc/main/config/quarkus-all-config.adoc b/_generated-doc/main/config/quarkus-all-config.adoc index fd551be049..6f7f04e641 100644 --- a/_generated-doc/main/config/quarkus-all-config.adoc +++ b/_generated-doc/main/config/quarkus-all-config.adoc @@ -67370,6 +67370,25 @@ h|[.extension-name]##REST Client## h|Type h|Default +a|icon:lock[title=Fixed at build time] [[quarkus-rest-client_quarkus-rest-client-disable-smart-produces]] [.property-path]##link:#quarkus-rest-client_quarkus-rest-client-disable-smart-produces[`quarkus.rest-client.disable-smart-produces`]## + +[.description] +-- +By default, RESTEasy Reactive uses text/plain content type for String values and application/json for everything else. + +MicroProfile Rest Client spec requires the implementations to always default to application/json. This build item disables the "smart" behavior of RESTEasy Reactive to comply to the spec + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REST_CLIENT_DISABLE_SMART_PRODUCES+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REST_CLIENT_DISABLE_SMART_PRODUCES+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a|icon:lock[title=Fixed at build time] [[quarkus-rest-client_quarkus-rest-client-provider-autodiscovery]] [.property-path]##link:#quarkus-rest-client_quarkus-rest-client-provider-autodiscovery[`quarkus.rest-client.provider-autodiscovery`]## [.description] diff --git a/_generated-doc/main/config/quarkus-rest-client.adoc b/_generated-doc/main/config/quarkus-rest-client.adoc index 86523b7eb9..2db243a7a9 100644 --- a/_generated-doc/main/config/quarkus-rest-client.adoc +++ b/_generated-doc/main/config/quarkus-rest-client.adoc @@ -7,6 +7,25 @@ h|[.header-title]##Configuration property## h|Type h|Default +a|icon:lock[title=Fixed at build time] [[quarkus-rest-client_quarkus-rest-client-disable-smart-produces]] [.property-path]##link:#quarkus-rest-client_quarkus-rest-client-disable-smart-produces[`quarkus.rest-client.disable-smart-produces`]## + +[.description] +-- +By default, RESTEasy Reactive uses text/plain content type for String values and application/json for everything else. + +MicroProfile Rest Client spec requires the implementations to always default to application/json. This build item disables the "smart" behavior of RESTEasy Reactive to comply to the spec + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REST_CLIENT_DISABLE_SMART_PRODUCES+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REST_CLIENT_DISABLE_SMART_PRODUCES+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a|icon:lock[title=Fixed at build time] [[quarkus-rest-client_quarkus-rest-client-provider-autodiscovery]] [.property-path]##link:#quarkus-rest-client_quarkus-rest-client-provider-autodiscovery[`quarkus.rest-client.provider-autodiscovery`]## [.description] diff --git a/_generated-doc/main/config/quarkus-rest-client_quarkus.rest-client.adoc b/_generated-doc/main/config/quarkus-rest-client_quarkus.rest-client.adoc index 86523b7eb9..2db243a7a9 100644 --- a/_generated-doc/main/config/quarkus-rest-client_quarkus.rest-client.adoc +++ b/_generated-doc/main/config/quarkus-rest-client_quarkus.rest-client.adoc @@ -7,6 +7,25 @@ h|[.header-title]##Configuration property## h|Type h|Default +a|icon:lock[title=Fixed at build time] [[quarkus-rest-client_quarkus-rest-client-disable-smart-produces]] [.property-path]##link:#quarkus-rest-client_quarkus-rest-client-disable-smart-produces[`quarkus.rest-client.disable-smart-produces`]## + +[.description] +-- +By default, RESTEasy Reactive uses text/plain content type for String values and application/json for everything else. + +MicroProfile Rest Client spec requires the implementations to always default to application/json. This build item disables the "smart" behavior of RESTEasy Reactive to comply to the spec + + +ifdef::add-copy-button-to-env-var[] +Environment variable: env_var_with_copy_button:+++QUARKUS_REST_CLIENT_DISABLE_SMART_PRODUCES+++[] +endif::add-copy-button-to-env-var[] +ifndef::add-copy-button-to-env-var[] +Environment variable: `+++QUARKUS_REST_CLIENT_DISABLE_SMART_PRODUCES+++` +endif::add-copy-button-to-env-var[] +-- +|boolean +|`false` + a|icon:lock[title=Fixed at build time] [[quarkus-rest-client_quarkus-rest-client-provider-autodiscovery]] [.property-path]##link:#quarkus-rest-client_quarkus-rest-client-provider-autodiscovery[`quarkus.rest-client.provider-autodiscovery`]## [.description] diff --git a/_versions/main/guides/rest-client.adoc b/_versions/main/guides/rest-client.adoc index 390a623a0d..1099003e89 100644 --- a/_versions/main/guides/rest-client.adoc +++ b/_versions/main/guides/rest-client.adoc @@ -2029,8 +2029,11 @@ To change this behavior, set the `quarkus.rest-client-reactive.scope` property t - it is not possible to set `HostnameVerifier` or `SSLContext` - a few things that don't make sense for a non-blocking implementations, such as setting the `ExecutorService`, don't work - - == Further reading * link:https://download.eclipse.org/microprofile/microprofile-rest-client-2.0/microprofile-rest-client-spec-2.0.html[MicroProfile Rest Client specification] + +== Configuration Reference + +include::{generated-dir}/config/quarkus-rest-client_quarkus.rest-client.adoc[opts=optional, leveloffset=+1] +include::{generated-dir}/config/quarkus-rest-client-config.adoc[opts=optional, leveloffset=+1] diff --git a/_versions/main/guides/resteasy-client.adoc b/_versions/main/guides/resteasy-client.adoc index a7df076880..6116c395b6 100644 --- a/_versions/main/guides/resteasy-client.adoc +++ b/_versions/main/guides/resteasy-client.adoc @@ -670,3 +670,7 @@ describes how to set it up in detail. == Further reading * link:https://download.eclipse.org/microprofile/microprofile-rest-client-2.0/microprofile-rest-client-spec-2.0.html[MicroProfile Rest Client specification] + +== Configuration Reference + +include::{generated-dir}/config/quarkus-rest-client-config.adoc[opts=optional, leveloffset=+1] From 6444d0f9d41fc3c1be61276c4a98c1f88efb4dd6 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Thu, 10 Oct 2024 07:01:57 +0000 Subject: [PATCH 10/16] Sync working groups --- _data/wg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index beea9a5a01..6ceb25874c 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -21,7 +21,7 @@ working-groups: <p>This is a great opportunity to participate in fun effort and be involved with the Quarkus community, if anyone is interested in being a part of this, please reach out to me π</p> status: on track completed: false - last-activity: 2024-10-09 + last-activity: 2024-10-10 last-update: | 0.0.3 has been released, it is the MVP version and allowed to publish the Roq blog: https://quarkiverse.io/quarkus-roq/posts/2024-08-29-welcome-to-roq/ From 982d63dc0dbb2e51993a9627d8bec9711146b333 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Thu, 10 Oct 2024 10:02:03 +0000 Subject: [PATCH 11/16] Sync working groups --- _data/wg.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index 6ceb25874c..b9d2c9c9c9 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -1,5 +1,17 @@ --- working-groups: + - title: "WebSocket Next" + board-url: "https://github.com/orgs/quarkusio/projects/26" + short-description: WebSocket-Next related tasks + readme: | + <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> + <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> + <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> + status: on track + completed: false + last-activity: 2024-10-10 + last-update: | + The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Roq :: Quarkus SSG" board-url: "https://github.com/orgs/quarkiverse/projects/6" short-description: Allow Static Site Generation with Quarkus. @@ -148,15 +160,3 @@ working-groups: last-activity: 2024-09-29 last-update: | Just got started. - - title: "WebSocket Next" - board-url: "https://github.com/orgs/quarkusio/projects/26" - short-description: WebSocket-Next related tasks - readme: | - <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> - <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> - <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> - status: on track - completed: false - last-activity: 2024-09-05 - last-update: | - The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. From fdb24c49a92e03d2803baab43ee625229903c07d Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Thu, 10 Oct 2024 16:10:02 +0000 Subject: [PATCH 12/16] Sync working groups --- _data/wg.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index b9d2c9c9c9..eb1b909995 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -1,17 +1,5 @@ --- working-groups: - - title: "WebSocket Next" - board-url: "https://github.com/orgs/quarkusio/projects/26" - short-description: WebSocket-Next related tasks - readme: | - <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> - <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> - <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> - status: on track - completed: false - last-activity: 2024-10-10 - last-update: | - The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Roq :: Quarkus SSG" board-url: "https://github.com/orgs/quarkiverse/projects/6" short-description: Allow Static Site Generation with Quarkus. @@ -42,6 +30,18 @@ working-groups: The target is to have 1.0.0 the 1 October 2024. For 1.0 we need pagination, tags and SEO. + - title: "WebSocket Next" + board-url: "https://github.com/orgs/quarkusio/projects/26" + short-description: WebSocket-Next related tasks + readme: | + <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> + <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> + <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> + status: on track + completed: false + last-activity: 2024-10-10 + last-update: | + The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Test classloading" board-url: "https://github.com/orgs/quarkusio/projects/30" short-description: The goal of this working group is to rewrite Quarkus's test classloading, so that tests are run in the same classloader as the application under tests, and Quarkus extensions can do "Quarkus-y" manipulations of test classes. From f921d13942dd826e84d63eab937b24994f453f66 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Fri, 11 Oct 2024 01:57:41 +0000 Subject: [PATCH 13/16] Sync documentation of main branch --- .../main/infra/quarkus-all-build-items.adoc | 25 ++++++++++++++++++- .../guides/extension-writing-dev-service.adoc | 6 ++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/_generated-doc/main/infra/quarkus-all-build-items.adoc b/_generated-doc/main/infra/quarkus-all-build-items.adoc index a04a4d33fc..fce99ce58c 100644 --- a/_generated-doc/main/infra/quarkus-all-build-items.adoc +++ b/_generated-doc/main/infra/quarkus-all-build-items.adoc @@ -4731,6 +4731,29 @@ _No Javadoc found_ +a| https://github.com/quarkusio/quarkus/blob/main/extensions/kubernetes/spi/src/main/java/io/quarkus/kubernetes/spi/KubernetesClusterRoleBindingBuildItem.java[`io.quarkus.kubernetes.spi.KubernetesClusterRoleBindingBuildItem`, window="_blank"] +[.description] +-- +Produce this build item to request the Kubernetes extension to generate a Kubernetes `ClusterRoleBinding` resource. The configuration here is limited; in particular, you can't specify subjects of the role binding. The role will always be bound to the application's service account. +-- a|`java.lang.String name` + +Name of the generated `RoleBinding` resource. Can be `null` , in which case the resource name is autogenerated. + +`io.quarkus.kubernetes.spi.RoleRef roleRef` + +RoleRef configuration. + +`io.quarkus.kubernetes.spi.Subject[] subjects` + +The target subjects. + +`java.util.Map<String,String> labels` + +The labels of the cluster role resource. + + + + a| https://github.com/quarkusio/quarkus/blob/main/extensions/kubernetes/spi/src/main/java/io/quarkus/kubernetes/spi/KubernetesClusterRoleBuildItem.java[`io.quarkus.kubernetes.spi.KubernetesClusterRoleBuildItem`, window="_blank"] [.description] -- @@ -5099,7 +5122,7 @@ a| https://github.com/quarkusio/quarkus/blob/main/extensions/kubernetes/spi/src/ [.description] -- Produce this build item to request the Kubernetes extension to generate a Kubernetes `RoleBinding` resource. -Note that this can't be used to generate a `ClusterRoleBinding` . +Use `KubernetesClusterRoleBindingBuildItem` to generate a `ClusterRoleBinding` . -- a|`java.lang.String name` Name of the generated `RoleBinding` resource. Can be `null` , in which case the resource name is autogenerated. diff --git a/_versions/main/guides/extension-writing-dev-service.adoc b/_versions/main/guides/extension-writing-dev-service.adoc index 7f9e18f3ba..27d96ce380 100644 --- a/_versions/main/guides/extension-writing-dev-service.adoc +++ b/_versions/main/guides/extension-writing-dev-service.adoc @@ -23,11 +23,11 @@ include::_attributes.adoc[] If your extension provides APIs for connecting to an external service, it's a good idea to provide a xref:dev-services.adoc[Dev Service] implementation. To create a Dev Service, add a new build step into the extension processor class that returns a `DevServicesResultBuildItem`. -Here, the link:https://hub.docker.com/_/hello-world`hello-world` image is used, but you should set up the right image for your service. +Here, the https://hub.docker.com/_/hello-world[`hello-world`] image is used, but you should set up the right image for your service. [source%nowrap,java] ---- - @BuildStep(onlyIfNot = IsNormal.class, onlyIf = GlobalDevServicesConfig.Enabled.class) { + @BuildStep(onlyIfNot = IsNormal.class, onlyIf = GlobalDevServicesConfig.Enabled.class) public DevServicesResultBuildItem createContainer() { DockerImageName dockerImageName = DockerImageName.parse("hello-world"); GenericContainer container = new GenericContainer<>(dockerImageName) @@ -89,7 +89,7 @@ For example, [source%nowrap,java] ---- - @BuildStep(onlyIfNot = IsNormal.class, onlyIf = GlobalDevServicesConfig.Enabled.class) { + @BuildStep(onlyIfNot = IsNormal.class, onlyIf = GlobalDevServicesConfig.Enabled.class) public DevServicesResultBuildItem createContainer(MyConfig config) { ---- From e5b3f85c2b3f7ff973f0538fab1b8776dcd1589d Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Fri, 11 Oct 2024 07:02:05 +0000 Subject: [PATCH 14/16] Sync working groups --- _data/wg.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index eb1b909995..2a702a9ab3 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -1,5 +1,17 @@ --- working-groups: + - title: "WebSocket Next" + board-url: "https://github.com/orgs/quarkusio/projects/26" + short-description: WebSocket-Next related tasks + readme: | + <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> + <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> + <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> + status: on track + completed: false + last-activity: 2024-10-11 + last-update: | + The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Roq :: Quarkus SSG" board-url: "https://github.com/orgs/quarkiverse/projects/6" short-description: Allow Static Site Generation with Quarkus. @@ -30,18 +42,6 @@ working-groups: The target is to have 1.0.0 the 1 October 2024. For 1.0 we need pagination, tags and SEO. - - title: "WebSocket Next" - board-url: "https://github.com/orgs/quarkusio/projects/26" - short-description: WebSocket-Next related tasks - readme: | - <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> - <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> - <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> - status: on track - completed: false - last-activity: 2024-10-10 - last-update: | - The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Test classloading" board-url: "https://github.com/orgs/quarkusio/projects/30" short-description: The goal of this working group is to rewrite Quarkus's test classloading, so that tests are run in the same classloader as the application under tests, and Quarkus extensions can do "Quarkus-y" manipulations of test classes. From 73126e65e2237fcc1b6f6677481a285ab3cff8e3 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Fri, 11 Oct 2024 08:02:56 +0000 Subject: [PATCH 15/16] Sync working groups --- _data/wg.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/_data/wg.yaml b/_data/wg.yaml index 2a702a9ab3..5dcc989277 100644 --- a/_data/wg.yaml +++ b/_data/wg.yaml @@ -1,17 +1,5 @@ --- working-groups: - - title: "WebSocket Next" - board-url: "https://github.com/orgs/quarkusio/projects/26" - short-description: WebSocket-Next related tasks - readme: | - <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> - <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> - <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> - status: on track - completed: false - last-activity: 2024-10-11 - last-update: | - The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Roq :: Quarkus SSG" board-url: "https://github.com/orgs/quarkiverse/projects/6" short-description: Allow Static Site Generation with Quarkus. @@ -33,7 +21,7 @@ working-groups: <p>This is a great opportunity to participate in fun effort and be involved with the Quarkus community, if anyone is interested in being a part of this, please reach out to me π</p> status: on track completed: false - last-activity: 2024-10-10 + last-activity: 2024-10-11 last-update: | 0.0.3 has been released, it is the MVP version and allowed to publish the Roq blog: https://quarkiverse.io/quarkus-roq/posts/2024-08-29-welcome-to-roq/ @@ -42,6 +30,18 @@ working-groups: The target is to have 1.0.0 the 1 October 2024. For 1.0 we need pagination, tags and SEO. + - title: "WebSocket Next" + board-url: "https://github.com/orgs/quarkusio/projects/26" + short-description: WebSocket-Next related tasks + readme: | + <p>The WebSocket Next <em>focus group</em> aims to improve our WebSocket experience.</p> + <p>Recently, we delivered a new approach to dealing with WebSocket (both for the server and client). This was the first step. There are still a few areas to improve, such as documentation, security, observability, and testability. The goal of this focus group is to track these efforts.</p> + <p>Point of contact: @mkouba (@<strong>Martin Kouba</strong> on Zulip)</p> + status: on track + completed: false + last-activity: 2024-10-11 + last-update: | + The last outstanding issue is OTel integration. @michalvavrik is working on a [pull request](https://github.com/quarkusio/quarkus/pull/41956). I will meet with Michal and Bruno in the coming weeks. The PR is quite massive and we need to review it carefully. - title: "Test classloading" board-url: "https://github.com/orgs/quarkusio/projects/30" short-description: The goal of this working group is to rewrite Quarkus's test classloading, so that tests are run in the same classloader as the application under tests, and Quarkus extensions can do "Quarkus-y" manipulations of test classes. From 0d460a573b44767c4b6c5f21e2f49420e1127aa9 Mon Sep 17 00:00:00 2001 From: GitHub Action <action@github.com> Date: Sat, 12 Oct 2024 02:03:58 +0000 Subject: [PATCH 16/16] Sync documentation of main branch --- _versions/main/guides/cdi-integration.adoc | 15 ++++ .../guides/websockets-next-reference.adoc | 69 +++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/_versions/main/guides/cdi-integration.adoc b/_versions/main/guides/cdi-integration.adoc index fe92dd294b..a68baa17ee 100644 --- a/_versions/main/guides/cdi-integration.adoc +++ b/_versions/main/guides/cdi-integration.adoc @@ -486,6 +486,21 @@ if (foo.getHandle().getBean().isActive()) { } ---- +If you want to consume only active beans, you can inject an `InjectableInstance<>` and call `getActive()` to get the single instance or `listActive()` to get all instances: + +[source,java] +---- +import io.quarkus.arc.InjectableInstance; + +@Inject +@Any +InjectableInstance<Foo> foos; + +for (Foo foo : foos.listActive()) + ... +} +---- + [[synthetic_observers]] == Use Case - Synthetic Observers diff --git a/_versions/main/guides/websockets-next-reference.adoc b/_versions/main/guides/websockets-next-reference.adoc index e36ea29734..36d7a9b98f 100644 --- a/_versions/main/guides/websockets-next-reference.adoc +++ b/_versions/main/guides/websockets-next-reference.adoc @@ -640,6 +640,40 @@ class MyBean { There are also other convenient methods. For example, `OpenConnections#findByEndpointId(String)` makes it easy to find connections for a specific endpoint. +==== User data + +It is also possible to associate arbitrary user data with a specific connection. +The `io.quarkus.websockets.next.UserData` object obtained by the `WebSocketConnection#userData()` method represents mutable user data associated with a connection. + +[source, java] +---- +import io.quarkus.websockets.next.WebSocketConnection; +import io.quarkus.websockets.next.UserData.TypedKey; + +@WebSocket(path = "/endpoint/{username}") +class MyEndpoint { + + @Inject + CoolService service; + + @OnOpen + void open(WebSocketConnection connection) { + connection.userData().put(TypedKey.forBoolean("isCool"), service.isCool(connection.pathParam("username"))); <1> + } + + @OnTextMessage + String process(String message) { + if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <2> + return "Cool message processed!"; + } else { + return "Message processed!"; + } + } +} +---- +<1> `CoolService#isCool()` returns `Boolean` that is associated with the current connection. +<2> The `TypedKey.forBoolean("isCool")` is the key used to obtain the data stored when the connection was created. + [[server-cdi-events]] ==== CDI events @@ -997,6 +1031,41 @@ class MyBean { There are also other convenient methods. For example, `OpenClientConnections#findByClientId(String)` makes it easy to find connections for a specific endpoint. +==== User data + +It is also possible to associate arbitrary user data with a specific connection. +The `io.quarkus.websockets.next.UserData` object obtained by the `WebSocketClientConnection#userData()` method represents mutable user data associated with a connection. + +[source, java] +---- +import io.quarkus.websockets.next.WebSocketClientConnection; +import io.quarkus.websockets.next.UserData.TypedKey; + +@WebSocketClient(path = "/endpoint/{username}") +class MyEndpoint { + + @Inject + CoolService service; + + @OnOpen + void open(WebSocketClientConnection connection) { + connection.userData().put(TypedKey.forBoolean("isCool"), service.isCool(connection.pathParam("username"))); <1> + } + + @OnTextMessage + String process(String message) { + if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <2> + return "Cool message processed!"; + } else { + return "Message processed!"; + } + } +} +---- +<1> `CoolService#isCool()` returns `Boolean` that is associated with the current connection. +<2> The `TypedKey.forBoolean("isCool")` is the key used to obtain the data stored when the connection was created. + + [[client-cdi-events]] ==== CDI events