Skip to content

Commit

Permalink
Merge pull request quarkusio#40633 from gsmet/3.8.5-backports-1
Browse files Browse the repository at this point in the history
[3.8] 3.8.5 backports 1
  • Loading branch information
gsmet authored May 15, 2024
2 parents 0ec3624 + 7a512a4 commit 1749d9d
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
2 changes: 1 addition & 1 deletion devtools/cli/distribution/jreleaser-maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project:
- java
links:
homepage: https://quarkus.io
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE.txt
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE

release:
github:
Expand Down
2 changes: 1 addition & 1 deletion devtools/cli/distribution/jreleaser-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project:
- java
links:
homepage: https://quarkus.io
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE.txt
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE

release:
github:
Expand Down
2 changes: 1 addition & 1 deletion devtools/cli/distribution/jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project:
- java
links:
homepage: https://quarkus.io
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE.txt
license: https://github.com/quarkusio/quarkus/blob/main/LICENSE

release:
github:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/cassandra.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public class FruitDto {

The translation to and from JSON is done automatically by the Quarkus RESTEasy Reactive extension, which is
included in this guide's pom.xml file. If you want to add it manually to your application, add the
below snippet to your application's ppm.xml file:
below snippet to your application's pom.xml file:

[source,xml]
----
Expand Down
3 changes: 2 additions & 1 deletion docs/src/main/asciidoc/config-yaml.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ quarkus:
----
quarkus:
datasource:
url: jdbc:postgresql://localhost:5432/quarkus_test
jdbc:
url: jdbc:postgresql://localhost:5432/quarkus_test
hibernate-orm:
database:
Expand Down
20 changes: 10 additions & 10 deletions docs/src/main/asciidoc/deploying-to-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ quarkus.kubernetes.annotations."app.quarkus/id"=42
----

[[env-vars]]
==== Environment variables
=== Environment variables

Kubernetes provides multiple ways of defining environment variables:

Expand All @@ -410,7 +410,7 @@ Kubernetes provides multiple ways of defining environment variables:
- interpolate a single value identified by a given field in a Secret or ConfigMap
- interpolate a value from a field within the same resource

===== Environment variables from key/value pairs
==== Environment variables from key/value pairs

To add a key/value pair as an environment variable in the generated resources:

Expand All @@ -423,7 +423,7 @@ The command above will add `MY_ENV_VAR=foobar` as an environment variable.
Please note that the key `my-env-var` will be converted to uppercase and dashes will be replaced by underscores resulting in `MY_ENV_VAR`.

[[secret-mapping]]
===== Environment variables from Secret
==== Environment variables from Secret

To add all key/value pairs of `Secret` as environment variables just apply the following configuration, separating each `Secret`
to be used as source by a comma (`,`):
Expand Down Expand Up @@ -467,7 +467,7 @@ This would generate the following in the `env` section of your container:
optional: false
----

===== Environment variables from ConfigMap
==== Environment variables from ConfigMap

To add all key/value pairs from `ConfigMap` as environment variables just apply the following configuration, separating each
`ConfigMap` to be used as source by a comma (`,`):
Expand Down Expand Up @@ -512,7 +512,7 @@ This would generate the following in the `env` section of your container:
optional: false
----

===== Environment variables from fields
==== Environment variables from fields

It's also possible to use the value from another field to add a new environment variable by specifying the path of the field to be used as a source, as follows:

Expand All @@ -532,7 +532,7 @@ quarkus.openshift.env.fields.foo=metadata.name
----
====

===== Validation
==== Validation

A conflict between two definitions, e.g. mistakenly assigning both a value and specifying that a variable is derived from a field, will result in an error being thrown at build time so that you get the opportunity to fix the issue before you deploy your application to your cluster where it might be more difficult to diagnose the source of the issue.

Expand Down Expand Up @@ -561,7 +561,7 @@ and a warning will be issued to alert you of the problem.For example, if you def
`quarkus.kubernetes.env-vars.my-env-var.value=foobar` and `quarkus.kubernetes.env.vars.my-env-var=newValue`, the extension will
only generate an environment variable `MY_ENV_VAR=newValue` and issue a warning.

==== Mounting volumes
=== Mounting volumes

The Kubernetes extension allows the user to configure both volumes and mounts for the application.
Any volume can be mounted with a simple configuration:
Expand All @@ -574,14 +574,14 @@ quarkus.kubernetes.mounts.my-volume.path=/where/to/mount
This will add a mount to the pod for volume `my-volume` to path `/where/to/mount`.
The volumes themselves can be configured as shown in the sections below.

===== Secret volumes
==== Secret volumes

[source,properties]
----
quarkus.kubernetes.secret-volumes.my-volume.secret-name=my-secret
----

===== ConfigMap volumes
==== ConfigMap volumes

[source,properties]
----
Expand Down Expand Up @@ -616,7 +616,7 @@ The application config volumes will be created using path: `/mnt/app-secret` and

Note: Users may use both properties at the same time.

=== Changing the number of replicas:
=== Changing the number of replicas

To change the number of replicas from 1 to 3:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/deploying-to-openshift.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can trigger a build and deployment in a single step or build the container i

To trigger a build and deployment in a single step:

:build-additional-parameters: -Dquarkus.kubernetes.deploy=true
:build-additional-parameters: -Dquarkus.openshift.deploy=true
include::{includes}/devtools/build.adoc[]
:!build-additional-parameters:

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/hibernate-orm-panache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,8 @@ If you need to mock entity instance methods, such as `persist()` you can do it b

[source,java]
----
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectMock;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -1322,8 +1322,8 @@ You can write your mocking test like this:

[source,java]
----
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectMock;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/javascript/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(tables){
var input = caption.firstElementChild.lastElementChild;
input.addEventListener("keyup", initiateSearch);
input.addEventListener("input", initiateSearch);
input.attributes.removeNamedItem('disabled');
if (input.attributes.disabled) input.attributes.removeNamedItem('disabled');
inputs[input.id] = {"table": table};
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ In this case the producer will use this method as generator to create an infinit
@Outgoing("prices-out") CompletionStage<Message<T>> generate();
----

=== Sending messages with @Emitter
=== Sending messages with Emitter

Sometimes, you need to have an imperative way of sending messages.

Expand Down
32 changes: 18 additions & 14 deletions docs/src/main/asciidoc/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The same flow can be applied with any of the <<logging-apis,supported logging AP
[source,java]
----
package com.example;
import org.jboss.logging.Logger;
public class MyService {
Expand Down Expand Up @@ -129,6 +130,8 @@ Once injected, you can use the `log` object to invoke logging methods.
.An example of two different types of logger injection:
[source, java]
----
package com.example;
import org.jboss.logging.Logger;
@ApplicationScoped
Expand Down Expand Up @@ -203,9 +206,8 @@ FINEST:: Increased debug output compared to `TRACE`, which might have a higher f

== Configure the log level, category, and format

JBoss Logging is built into Quarkus and provides link:https://quarkus.io/developer-joy/[unified configuration] for all <<logging-apis,supported logging APIs>>.

Configure the runtime logging in the `application.properties` file.
JBoss Logging, integrated into Quarkus, offers a unified configuration for all <<logging-apis,supported logging APIs>> through a single configuration file that sets up all available extensions.
To adjust runtime logging, modify the `application.properties` file.

.An example of how you can set the default log level to `INFO` logging and include Hibernate `DEBUG` logs:
[source, properties]
Expand Down Expand Up @@ -347,9 +349,9 @@ The logging format string supports the following symbols:
|%t|Thread name|Render the thread name.
|%t{id}|Thread ID|Render the thread ID.
|%z{<zone name>}|Time zone|Set the time zone of the output to `<zone name>`.
|%X{<MDC property name>}|Mapped Diagnostic Context Value|Renders the value from Mapped Diagnostic Context
|%X|Mapped Diagnostic Context Values|Renders all the values from Mapped Diagnostic Context in format {property.key=property.value}
|%x|Nested Diagnostics context values|Renders all the values from Nested Diagnostics Context in format {value1.value2}
|%X{<MDC property name>}|Mapped Diagnostic Context Value|Renders the value from Mapped Diagnostic Context.
|%X|Mapped Diagnostic Context Values|Renders all the values from Mapped Diagnostic Context in format `{property.key=property.value}`.
|%x|Nested Diagnostics context values|Renders all the values from Nested Diagnostics Context in format `{value1.value2}`.
|===


Expand All @@ -364,8 +366,8 @@ Changing the console log format is useful, for example, when the console output

The `quarkus-logging-json` extension may be employed to add support for the JSON logging format and its related configuration.

Add this extension to your build file as the following snippet illustrates:

. Add this extension to your build file as the following snippet illustrates:
+
[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
----
Expand All @@ -374,20 +376,21 @@ Add this extension to your build file as the following snippet illustrates:
<artifactId>quarkus-logging-json</artifactId>
</dependency>
----

+
[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
implementation("io.quarkus:quarkus-logging-json")
----

+
By default, the presence of this extension replaces the output format configuration from the console configuration, and the format string and the color settings (if any) are ignored.
The other console configuration items, including those controlling asynchronous logging and the log level, will continue to be applied.

+
For some, it will make sense to use humanly readable (unstructured) logging in dev mode and JSON logging (structured) in production mode.
This can be achieved using different profiles, as shown in the following configuration.

.Disable JSON logging in application.properties for dev and test mode
+
. Disable JSON logging in application.properties for dev and test mode:
+
[source, properties]
----
%dev.quarkus.log.console.json=false
Expand Down Expand Up @@ -443,7 +446,6 @@ To log events to a file on the application's host, use the Quarkus file log hand
The file log handler is disabled by default, so you must first enable it.

The Quarkus file log handler supports log file rotation.
Log file rotation ensures effective log file management over time by maintaining a specified number of backup log files, while also keeping the primary log file up-to-date and manageable.

Log file rotation ensures effective log file management over time by maintaining a specified number of backup log files, while keeping the primary log file up-to-date and manageable.

Expand Down Expand Up @@ -514,6 +516,8 @@ To register a logging filter:
.An example of writing a filter:
[source,java]
----
package com.example;
import io.quarkus.logging.LoggingFilter;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/pulsar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ Note that dead letter topic can be used in different message redelivery methods,
----
mp.messaging.incoming.data.failure-strategy=reconsume-later
mp.messaging.incoming.data.reconsumeLater.delay=5000
mp.messaging.incoming.data.enableRetry=true
mp.messaging.incoming.data.retryEnable=true
mp.messaging.incoming.data.negativeAck.redeliveryBackoff=1000,60000,2
----

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/rest-client-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,8 @@ import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectMock;
@QuarkusTest
public class InjectMockTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class AdditionalFieldConfig {

/**
* Additional field type specification.
* Supported types: string, int, long
* Supported types: {@code string}, {@code int}, and {@code long}.
* String is the default if not specified.
*/
@ConfigItem(defaultValue = "string")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down

0 comments on commit 1749d9d

Please sign in to comment.