Skip to content

Commit acdbc2a

Browse files
committed
Sync documentation of main branch
1 parent 24e317c commit acdbc2a

File tree

6 files changed

+66
-37
lines changed

6 files changed

+66
-37
lines changed

_generated-doc/main/infra/quarkus-all-build-items.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -9598,6 +9598,10 @@ _No Javadoc found_
95989598

95999599
_No Javadoc found_
96009600

9601+
`io.quarkus.websockets.next.deployment.Callback onPingMessage`
9602+
9603+
_No Javadoc found_
9604+
96019605
`io.quarkus.websockets.next.deployment.Callback onPongMessage`
96029606

96039607
_No Javadoc found_

_versions/main/guides/datasource.adoc

+13
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,19 @@ AgroalDataSource defaultDataSource;
294294
In the above example, the type is `AgroalDataSource`, a `javax.sql.DataSource` subtype.
295295
Because of this, you can also use `javax.sql.DataSource` as the injected type.
296296

297+
===== Oracle considerations
298+
299+
As documented in https://github.com/quarkusio/quarkus/issues/36265[issue #36265],
300+
Oracle has a very weird behavior of committing the uncommitted transactions on connection closing.
301+
302+
Which means that when stopping Quarkus for instance, in progress transactions might be committed even if incomplete.
303+
304+
Given that is not the expected behavior and that it could lead to data loss, we added an interceptor that rolls back any unfinished transactions at connection close,
305+
provided you are not using XA (in which case the transaction manager handles things for you).
306+
307+
If this behavior introduced in 3.18 causes issues for your specific workload, you can disable it by setting the `-Dquarkus-oracle-no-automatic-rollback-on-connection-close` system property to `true`.
308+
Please take the time to report your use case in our https://github.com/quarkusio/quarkus/issues[issue tracker] so that we can adjust this behavior if needed.
309+
297310
[[reactive-datasource]]
298311
==== Reactive datasource
299312

_versions/main/guides/deploying-to-kubernetes.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ of secret that contains the required credentials. Quarkus can automatically gene
301301
quarkus.kubernetes.generate-image-pull-secret=true
302302
----
303303

304-
More specifically a `Secret`like the one bellow is genrated:
304+
More specifically a `Secret` like the one below is generated:
305305

306306
[source,yaml]
307307
----

_versions/main/guides/kubernetes-client.adoc

+15-21
Original file line numberDiff line numberDiff line change
@@ -474,49 +474,43 @@ public class OpenShiftClientProducer {
474474
}
475475
----
476476

477-
Mock support is also provided in a similar fashion:
477+
Mock support is also provided in a similar fashion by using the `@WithKubernetesTestServer` explained in the previous section:
478478

479479
[source, java]
480480
----
481-
@QuarkusTestResource(OpenShiftMockServerTestResource.class)
481+
@WithKubernetesTestServer
482482
@QuarkusTest
483483
public class OpenShiftClientTest {
484484
485-
@MockServer
486-
private OpenShiftMockServer mockServer;
487-
...
488-
----
489-
490-
Or by using the `@WithOpenShiftTestServer` similar to the `@WithKubernetesTestServer` explained in the
491-
previous section:
492-
493-
[source, java]
494-
----
495-
@WithOpenShiftTestServer
496-
@QuarkusTest
497-
public class OpenShiftClientTest {
485+
@KubernetesTestServer
486+
KubernetesServer mockServer;
487+
@Inject
488+
OpenShiftClient client;
498489
499-
@OpenShiftTestServer
500-
private OpenShiftServer mockOpenShiftServer;
501-
...
490+
@Test
491+
public void testInteractionWithAPIServer() {
492+
RestAssured.when().get("/route/test").then()
493+
.body("size()", is(2));
494+
}
495+
}
502496
----
503497

504-
To use this feature, you have to add a dependency on `quarkus-test-openshift-client`:
498+
To use this feature, you have to add a dependency on `quarkus-test-kubernetes-client`:
505499

506500
[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
507501
.pom.xml
508502
----
509503
<dependency>
510504
<groupId>io.quarkus</groupId>
511-
<artifactId>quarkus-test-openshift-client</artifactId>
505+
<artifactId>quarkus-test-kubernetes-client</artifactId>
512506
<scope>test</scope>
513507
</dependency>
514508
----
515509

516510
[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
517511
.build.gradle
518512
----
519-
testImplementation("io.quarkus:quarkus-test-openshift-client")
513+
testImplementation("io.quarkus:quarkus-test-kubernetes-client")
520514
----
521515

522516
== Configuration Reference

_versions/main/guides/security-webauthn.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@ import io.quarkus.test.security.webauthn.WebAuthnEndpointHelper;
11791179
import io.quarkus.test.security.webauthn.WebAuthnHardware;
11801180
import io.restassured.RestAssured;
11811181
import io.restassured.filter.Filter;
1182+
import io.restassured.filter.cookie.CookieFilter;
11821183
import io.restassured.specification.RequestSpecification;
11831184
import io.vertx.core.json.JsonObject;
11841185
@@ -1207,7 +1208,7 @@ public class WebAuthnResourceTest {
12071208
}
12081209
12091210
private void testWebAuthn(String username, User user, Endpoint endpoint) {
1210-
Filter cookieFilter = new RenardeCookieFilter();
1211+
Filter cookieFilter = new CookieFilter();
12111212
WebAuthnHardware token = new WebAuthnHardware(url);
12121213
12131214
verifyLoggedOut(cookieFilter);

_versions/main/guides/websockets-next-reference.adoc

+31-14
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ implementation("io.quarkus:quarkus-websockets-next")
7979

8080
Both the <<server-api>> and <<client-api>> define _endpoints_ that are used to consume and send messages.
8181
The endpoints are implemented as CDI beans and support injection.
82-
Endpoints declare <<callback-methods,_callback methods_>> annotated with `@OnTextMessage`, `@OnBinaryMessage`, `@OnPong`, `@OnOpen`, `@OnClose` and `@OnError`.
82+
Endpoints declare <<callback-methods,_callback methods_>> annotated with `@OnTextMessage`, `@OnBinaryMessage`, `@OnPingMessage`, `@OnPongMessage`, `@OnOpen`, `@OnClose` and `@OnError`.
8383
These methods are used to handle various WebSocket events.
8484
Typically, a method annotated with `@OnTextMessage` is called when the connected client sends a message to the server and vice versa.
8585

@@ -210,6 +210,7 @@ A WebSocket endpoint may declare:
210210

211211
* At most one `@OnTextMessage` method: Handles the text messages from the connected client/server.
212212
* At most one `@OnBinaryMessage` method: Handles the binary messages from the connected client/server.
213+
* At most one `@OnPingMessage` method: Handles the ping messages from the connected client/server.
213214
* At most one `@OnPongMessage` method: Handles the pong messages from the connected client/server.
214215
* At most one `@OnOpen` method: Invoked when a connection is opened.
215216
* At most one `@OnClose` method: Executed when the connection is closed.
@@ -551,39 +552,55 @@ Item find(Item item) {
551552
1. Specify the codec to use for the deserialization of the incoming message
552553
2. Specify the codec to use for the serialization of the outgoing message
553554

554-
=== Ping/pong messages
555+
=== Ping/Pong messages
555556

556557
A https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2[ping message] may serve as a keepalive or to verify the remote endpoint.
557558
A https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.3[pong message] is sent in response to a ping message and it must have an identical payload.
558559

559-
Server/client endpoints automatically respond to a ping message sent from the client/server.
560-
In other words, there is no need for `@OnPingMessage` callback declared on an endpoint.
560+
==== Sending ping messages
561561

562-
The server can send ping messages to a connected client.
563-
`WebSocketConnection`/`WebSocketClientConnection` declare methods to send ping messages; there is a non-blocking variant: `sendPing(Buffer)` and a blocking variant: `sendPingAndAwait(Buffer)`.
564-
By default, the ping messages are not sent automatically.
565-
However, the configuration properties `quarkus.websockets-next.server.auto-ping-interval` and `quarkus.websockets-next.client.auto-ping-interval` can be used to set the interval after which, the server/client sends a ping message to a connected client/server automatically.
562+
Ping messages are optional and not sent by default. However, server and client endpoints can be configured to automatically send ping messages on an interval.
566563

567564
[source,properties]
568565
----
569566
quarkus.websockets-next.server.auto-ping-interval=2 <1>
567+
quarkus.websockets-next.client.auto-ping-interval=10 <2>
570568
----
571-
<1> Sends a ping message from the server to a connected client every 2 seconds.
569+
<1> Sends a ping message from the server to each connected client every 2 seconds.
570+
<2> Sends a ping message from all connected client instances to their remote servers every 10 seconds.
572571

573-
The `@OnPongMessage` annotation is used to define a callback that consumes pong messages sent from the client/server.
574-
An endpoint must declare at most one method annotated with `@OnPongMessage`.
572+
Servers and clients can send ping messages programmatically at any time using `WebSocketConnection` or `WebSocketClientConnection`.
573+
There is a non-blocking variant: `Sender#sendPing(Buffer)` and a blocking variant: `Sender#sendPingAndAwait(Buffer)`.
574+
575+
==== Sending pong messages
576+
577+
Server and client endpoints will always respond to a ping message sent from the remote party with a corresponding pong message, using the application data from the ping message.
578+
This behavior is built-in and requires no additional code or configuration.
579+
580+
Servers and clients can send unsolicited pong messages that may serve as a unidirectional heartbeat using `WebSocketConnection` or `WebSocketClientConnection`. There is a non-blocking variant: `Sender#sendPong(Buffer)` and a blocking variant: `Sender#sendPongAndAwait(Buffer)`.
581+
582+
==== Handling ping/pong messages
583+
584+
Because ping messages are handled automatically and pong messages require no response, it is not necessary to write handlers for these messages to comply with the WebSocket protocol.
585+
However, it is sometimes useful to know when ping or pong messages are received by an endpoint.
586+
587+
The `@OnPingMessage` and `@OnPongMessage` annotations can be used to define callbacks that consume ping or pong messages sent from the remote party.
588+
An endpoint may declare at most one `@OnPingMessage` callback and at most one `@OnPongMessage` callback.
575589
The callback method must return either `void` or `Uni<Void>` (or be a Kotlin `suspend` function returning `Unit`), and it must accept a single parameter of type `Buffer`.
576590

577591
[source,java]
578592
----
593+
@OnPingMessage
594+
void ping(Buffer data) {
595+
// an incoming ping that will automatically receive a pong
596+
}
597+
579598
@OnPongMessage
580599
void pong(Buffer data) {
581-
// ....
600+
// an incoming pong in response to the last ping sent
582601
}
583602
----
584603

585-
NOTE: The server/client can also send unsolicited pong messages that may serve as a unidirectional heartbeat. There is a non-blocking variant: `WebSocketConnection#sendPong(Buffer)` and also a blocking variant: `WebSocketConnection#sendPongAndAwait(Buffer)`.
586-
587604
[[inbound-processing-mode]]
588605
=== Inbound processing mode
589606

0 commit comments

Comments
 (0)