Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
spolti authored Nov 15, 2022
2 parents 9e3cdec + 7f80b92 commit d276216
Show file tree
Hide file tree
Showing 134 changed files with 7,526 additions and 294 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -715,14 +715,10 @@ jobs:
uses: graalvm/setup-graalvm@v1
if: startsWith(matrix.os-name, 'windows')
with:
version: 'latest'
version: 'mandrel-latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install native-image component
if: startsWith(matrix.os-name, 'windows')
run: |
gu.cmd install native-image
# We do this so we can get better analytics for the downloaded version of the build images
- name: Update Docker Client User Agent
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<quartz.version>2.3.2</quartz.version>
<h2.version>2.1.214</h2.version>
<postgresql-jdbc.version>42.5.0</postgresql-jdbc.version>
<mariadb-jdbc.version>3.0.8</mariadb-jdbc.version>
<mariadb-jdbc.version>3.0.9</mariadb-jdbc.version>
<mysql-jdbc.version>8.0.30</mysql-jdbc.version>
<mssql-jdbc.version>11.2.0.jre11</mssql-jdbc.version>
<adal4j.version>1.6.7</adal4j.version>
Expand All @@ -145,9 +145,9 @@
<strimzi-test-container.version>0.100.0</strimzi-test-container.version>
<!-- Scala is used by Kafka so we need to choose a compatible version -->
<scala.version>2.13.10</scala.version>
<aws-lambda-java.version>1.2.1</aws-lambda-java.version>
<aws-lambda-java.version>1.2.2</aws-lambda-java.version>
<aws-lambda-java-events.version>3.11.0</aws-lambda-java-events.version>
<aws-xray.version>2.12.0</aws-xray.version>
<aws-xray.version>2.13.0</aws-xray.version>
<azure-functions-java-library.version>1.4.2</azure-functions-java-library.version>
<kotlin.version>1.7.21</kotlin.version>
<kotlin.coroutine.version>1.6.4</kotlin.coroutine.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<forbiddenapis-maven-plugin.version>3.1</forbiddenapis-maven-plugin.version>

<!-- platform properties - this is a floating tag -->
<platform.quarkus.native.builder-image>graalvm</platform.quarkus.native.builder-image>
<platform.quarkus.native.builder-image>mandrel</platform.quarkus.native.builder-image>

<script.extension>sh</script.extension>
<docker-prune.location>${maven.multiModuleProjectDirectory}/.github/docker-prune.${script.extension}</docker-prune.location>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public Result get() {

Class<?> configurationClass = Thread.currentThread().getContextClassLoader()
.loadClass("org.testcontainers.utility.TestcontainersConfiguration");
Object configurationInstance = configurationClass.getMethod("instance").invoke(null);
Object configurationInstance = configurationClass.getMethod("getInstance").invoke(null);
String oldReusePropertyValue = (String) configurationClass
.getMethod("getUserProperty", String.class, String.class)
.invoke(configurationInstance, "testcontainers.reuse.enable", "false"); // use the default provided in TestcontainersConfiguration#environmentSupportsReuse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ private void periodicTestCompile() {
scanLock.lock();
TestScanningLock.lockForTests();
try {
ClassScanResult changedTestClassResult = compileTestClasses();
ClassScanResult changedApp = checkForChangedClasses(compiler, DevModeContext.ModuleInfo::getMain, false, test,
true);
ClassScanResult changedTestClassResult = compileTestClasses();
if (changedApp.compilationHappened) {
if (testCompileProblem != null) {
testSupport.testCompileFailed(testCompileProblem);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.runtime.logging;

import java.io.File;
import java.nio.charset.Charset;
import java.util.Optional;
import java.util.logging.Level;

Expand Down Expand Up @@ -46,6 +47,12 @@ public class FileConfig {
@ConfigItem
Optional<String> filter;

/**
* The character encoding used
*/
@ConfigItem
Optional<Charset> encoding;

/**
* File async logging config
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -631,6 +632,13 @@ private static Handler configureFileHandler(final FileConfig config, final Error
handler.setErrorManager(errorManager);
handler.setLevel(config.level);
handler.setFilter(cleanupFilter);
if (config.encoding.isPresent()) {
try {
handler.setEncoding(config.encoding.get().name());
} catch (UnsupportedEncodingException e) {
errorManager.error("Failed to set character encoding", e, ErrorManager.GENERIC_FAILURE);
}
}
applyFilter(validateFilters, errorManager, cleanupFilter, config.filter, namedFilters, handler);

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

subprojects {
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/deploying-to-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ This would generate the following entry in the `container` section:
[source, yaml]
----
containers:
resources:
- resources:
limits:
cpu: 1000m
memory: 512Mi
Expand Down Expand Up @@ -667,7 +667,7 @@ After deploying these resources to Kubernetes, the Ingress resource will allow u

To customize the default `host` and `path` properties of the generated Ingress resources, you need to apply the following configuration:

[source]
[source, properties]
----
quarkus.kubernetes.ingress.expose=true
# To change the Ingress host. By default, it's empty.
Expand Down Expand Up @@ -703,7 +703,7 @@ spec:

Additionally, you can also add new Ingress rules by adding the following configuration:

[source]
[source, properties]
----
# Example to add a new rule
quarkus.kubernetes.ingress.rules.1.host=dev.svc.url
Expand Down
88 changes: 87 additions & 1 deletion docs/src/main/asciidoc/extension-codestart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,91 @@ Each codestart consists of:

The https://github.com/quarkusio/quarkus/tree/main/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus[base codestarts, window="_blank"] contains templates to create project, buildtool, languages, config and tooling files.

In addition, Quarkus also provides the following ways to initialize a new extension project with a Codestart:

[role="primary asciidoc-tabs-sync-cli"]
.CLI
****
To create a new extension with a Codestart skeleton provide the `--codestart` flag to the `create extension` command:
[source,bash,subs=attributes+]
----
quarkus create extension --codestart org.acme:greeting-extension
----
[source,shell,subs=attributes+]
----
Detected layout type is 'standalone'
Generated runtime artifactId is 'greeting-extension'
applying codestarts...
📚 java
🔨 maven
📦 quarkus-extension
🚀 devmode-test
🚀 extension-base
🚀 extension-codestart
🚀 integration-tests
🚀 unit-test
-----------
👍 extension has been successfully generated in:
--> /Users/.../greeting-extension
-----------
Navigate into this directory and get started: quarkus build
----
_For more information about how to install the Quarkus CLI and use it, please refer to xref:cli-tooling.adoc[the Quarkus CLI guide]._
****

[role="secondary asciidoc-tabs-sync-maven"]
.Maven
****
Quarkus provides the <<building-my-first-extension.adoc#maven-setup,`create-extension` Maven Mojo>> to initialize an extension project.
To generate a new extension with a Codestart skeleton provide the `-DwithCodestart` flag to this Mojo:
[source,bash,subs=attributes+]
----
mvn io.quarkus.platform:quarkus-maven-plugin:{quarkus-version}:create-extension -N \
-DgroupId=org.acme \
-DextensionId=greeting-extension \
-DwithCodestart
----
[source,shell,subs=attributes+]
----
[INFO] --- quarkus-maven-plugin:{quarkus-version}:create-extension (default-cli) @ standalone-pom ---
Detected layout type is 'standalone'
Generated runtime artifactId is 'greeting-extension'
applying codestarts...
📚 java
🔨 maven
📦 quarkus-extension
🚀 devmode-test
🚀 extension-base
🚀 extension-codestart
🚀 integration-tests
🚀 unit-test
-----------
👍 extension has been successfully generated in:
--> /Users/.../greeting-extension
-----------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.638 s
[INFO] Finished at: 2022-10-24T21:27:51+02:00
[INFO] ------------------------------------------------------------------------
----
****



== Writing an Extension Codestart

Here is a step-by-step guide to write an extension codestart. You may also watch the https://www.youtube.com/watch?v=lLyVDqVK8cE[Quarkus Insight #99] with a live-coding session.
Expand All @@ -80,7 +165,8 @@ Let's take `io.quarkiverse.aloha:quarkus-aloha` as an example extension GAV (don
=== The code

A Codestart is a template for scaffolding new project.
The easiest way to prepare a Codestart is to generate a Quarkus project, add the content you want in your template and then create your Codestart from there.

In this tutorial a Codestart project is created from a Quarkus project and adding the needed templates.

Therefore, go to https://code.quarkus.io[code.quarkus.io, window="_blank"], create a new project with the aloha extension and `org.acme` as Group (i.e <<org-acme-package>>). Prepare a nice starter. It should not include any business logic, instead, it should contain some stub data/hello world that compiles and gives an overview of how to use the extension. The idea is to bring code that is the most common starting point for the extension.

Expand Down
25 changes: 25 additions & 0 deletions docs/src/main/asciidoc/grpc-service-consumption.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,28 @@ By default, when starting the application in dev mode, a gRPC server is started,
You can configure the gRPC extension's dev mode behavior using the following properties.

include::{generated-dir}/config/quarkus-grpc-config-group-grpc-dev-mode-config.adoc[opts=optional, leveloffset=+1]

== Inject mock clients

In your `@QuarkuTest`, you can use `@InjectMock` to inject the Mutiny client of a gRPC service:

[source, java]
----
@QuarkusTest
public class GrpcMockTest {
@InjectMock
@GrpcClient("hello")
Greeter greeter;
@Test
void test1() {
HelloRequest request = HelloRequest.newBuilder().setName("neo").build();
Mockito.when(greeter.sayHello(Mockito.any(HelloRequest.class)))
.thenReturn(Uni.createFrom().item(HelloReply.newBuilder().setMessage("hello neo").build()));
Assertions.assertEquals(greeter.sayHello(request).await().indefinitely().getMessage(), "hello neo");
}
}
----

IMPORTANT: Only the Mutiny client can be _mocked_, channels, and other stubs cannot be mocked.
33 changes: 32 additions & 1 deletion docs/src/main/asciidoc/rabbitmq-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,26 @@ Type: _boolean_ | false | `true`

Type: _long_ | false |

| [.no-hyphens]#*queue.single-active-consumer*# | If set to true, only one consumer can actively consume messages

Type: _boolean_ | false | 'false'

| [.no-hyphens]#*queue.x-queue-type*# | If automatically declare queue, we can choose different types of queue [quorum, classic, stream]

Type: _string_ | false | 'classic'

| [.no-hyphens]#*queue.x-queue-mode*# | If automatically declare queue, we can choose different modes of queue [lazy, default]

Type: _string_ | false | 'default'

| [.no-hyphens]#*max-incoming-internal-queue-size*# | The maximum size of the incoming internal queue

Type: _int_ | false |

| [.no-hyphens]#*connection-count*# | The number of RabbitMQ connections to create for consuming from this queue. This might be necessary to consume from a sharded queue with a single client.

Type: _int_ | false | '1'

| [.no-hyphens]#*auto-bind-dlq*# | Whether to automatically declare the DLQ and bind it to the binder DLX

Type: _boolean_ | false | `false`
Expand All @@ -659,6 +675,14 @@ Type: _string_ | false |

Type: _boolean_ | false | `false`

| [.no-hyphens]#*dead-letter-queue-type*# | If automatically declare DLQ, we can choose different types of DLQ [quorum, classic, stream]

Type: _string_ | false | `classic`

| [.no-hyphens]#*dead-letter-queue-mode*# | If automatically declare DLQ, we can choose different modes of DLQ [lazy, default]

Type: _string_ | false | `default`

| [.no-hyphens]#*failure-strategy*# | The failure strategy to apply when a RabbitMQ message is nacked. Accepted values are `fail`, `accept`, `reject` (default)

Type: _string_ | false | `reject`
Expand All @@ -679,6 +703,13 @@ Type: _boolean_ | false | `false`

Type: _string_ | false | `#`

| [.no-hyphens]#*content-type-override*# | Override the content_type attribute of the incoming message, should be a valid MINE type

Type: _string_ | false |

| [.no-hyphens]#*max-outstanding-messages*# | The maximum number of outstanding/unacknowledged messages being processed by the connector at a time; must be a positive number

Type: _int_ | false |
|===


Expand Down Expand Up @@ -844,4 +875,4 @@ Type: _string_ | false |

Type: _string_ | false | `/`

|===
|===
2 changes: 2 additions & 0 deletions docs/src/main/asciidoc/redis-dev-services.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ we recommend that you use the `%prod.` profile to define your Redis settings.
Dev Services for Redis relies on Docker to start the server.
If your environment does not support Docker, you will need to start the server manually, or connect to an already running server.

IMPORTANT: If you want to use Redis Stack _modules_ (bloom, graph, search...), set the image-name to `redis/redis-stack:latest`

== Shared server

Most of the time you need to share the server between applications.
Expand Down
14 changes: 8 additions & 6 deletions docs/src/main/asciidoc/redis-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,14 @@ As mentioned above, the API is divided into groups:
- stream (not available yet)
- string - `.value(valueType)`
- transactions - `withTransaction`
- json - `.json()` (requires the https://redis.com/modules/redis-json/[redis-json] module on the server side)
- bloom - `.bloom()` (requires the https://redis.com/modules/redis-bloom/[redis-bloom] module on the server side)
- cuckoo - `.cuckoo()` (requires the https://redis.com/modules/redis-bloom/[redis-bloom] module on the server side, which also provides the cuckoo filter commands)
- count-min - `.countmin()` (requires the https://redis.com/modules/redis-bloom/[redis-bloom] module on the server side, which also provides the count-min filter commands)
- top-k - `.topk()` (requires the https://redis.com/modules/redis-bloom/[redis-bloom] module on the server side, which also provides the top-k filter commands)
- graph - `.graph()` (requires the https://redis.com/modules/redis-graph/[redis-graph] module on the server side, which also provides the graph commands)
- json - `.json()` (requires the https://redis.com/modules/redis-json/[RedisJSON] module on the server side)
- bloom - `.bloom()` (requires the https://redis.com/modules/redis-bloom/[RedisBloom] module on the server side)
- cuckoo - `.cuckoo()` (requires the https://redis.com/modules/redis-bloom/[rRedisBloom] module on the server side, which also provides the cuckoo filter commands)
- count-min - `.countmin()` (requires the https://redis.com/modules/redis-bloom/[RedisBloom] module on the server side, which also provides the count-min filter commands)
- top-k - `.topk()` (requires the https://redis.com/modules/redis-bloom/[RedisBloom] module on the server side, which also provides the top-k filter commands)
- graph - `.graph()` (requires the https://redis.com/modules/redis-graph/[RedisGraph] module on the server side).
These commands are marked as experimental, as we would need feedback before making them stable.
- search - `.search()` (requires the https://redis.com/modules/redis-search/[RedisSearch] module on the server side).
These commands are marked as experimental, as we would need feedback before making them stable.

Each of these methods returns an object that lets you execute the commands related to the group.
Expand Down
Loading

0 comments on commit d276216

Please sign in to comment.