From 630a3fd4e9ea2d7a982b6482a7d49c0429d46422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szynkiewicz?= Date: Mon, 25 Jan 2021 23:23:35 +0100 Subject: [PATCH] Reactive Messaging HTTP quickstart fixes, #14551 --- .../asciidoc/reactive-messaging-http.adoc | 79 ++++++++++++++++++- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/docs/src/main/asciidoc/reactive-messaging-http.adoc b/docs/src/main/asciidoc/reactive-messaging-http.adoc index 8db4d89302f64..b96d49648df2f 100644 --- a/docs/src/main/asciidoc/reactive-messaging-http.adoc +++ b/docs/src/main/asciidoc/reactive-messaging-http.adoc @@ -280,8 +280,7 @@ Create the `src/main/resources/META-INF/resources/index.html` file, with the fol == Get it running -If you followed the instructions, you should have the AMQP broker running. -Then, you just need to run the application using: +Run the application using: [source,bash] ---- @@ -290,7 +289,6 @@ Then, you just need to run the application using: Open `http://localhost:8080/index.html` in your browser. -NOTE: If you started the AMQP broker with docker compose, stop it using `CTRL+C` followed by `docker-compose down`. == Running Native @@ -303,6 +301,46 @@ You can build the native executable with: == Going further +=== HTTP connector options +All `quarkus-http` connector options: + +[source, properties] +---- +# OUTGOING + +# The target URL +mp.messaging.outgoing..url=http://localhost:8213 + +# Message payload serializer, optional, implementation of `io.quarkus.reactivemessaging.http.runtime.serializers.Serializer` +mp.messaging.outgoing..serializer=com.example.MySerializer + +# The number of attempts to make for sending a request to a remote endpoint. Must not be less than zero +# Zero by default +mp.messaging.outgoing..maxRetries=3 + +# Configures the random factor when using back-off with maxRetries > 0. 0.5 by default +mp.messaging.outgoing..jitter=0.3 + +# Configures a back-off delay between attempts to send a request. +# A random factor (jitter) is applied to increase the delay when several failures happen. +mp.messaging.outgoing..delay=1s + +#The HTTP method (either `POST` or `PUT`), `POST` by default +mp.messaging.outgoing..method=PUT + +#INCOMING +# The HTTP method (either `POST` or `PUT`, `POST` by default +mp.messaging.incoming..method=POST + +# The path of the endpoint +mp.messaging.incoming..path=/my-reactive-ws-endpoint + +# HTTP endpoint buffers messages if a consumer is not able to keep up. This setting specifies the size of the buffer. +# 8 by default. +mp.messaging.incoming..buffer-size=13 + +---- + === WebSockets Except of the `quarkus-http` connector, the `quarkus-reactive-messaging-http` extension also brings in `quarkus-websocket` - a connector for exposing and feeding WebSockets. @@ -312,6 +350,41 @@ NOTE: While the sink of the HTTP connector checks if the message is consumed by the WebSocket sink does not. It may happen that a failure to receive a message is not reported, e.g. if the remote side closes the WebSocket connection in a crucial moment. +The `quarkus-websocket` connector is configured with the following properties: + +[source,properties] +---- +# OUTGOING + +# The target URL +mp.messaging.outgoing..url=ws://localhost:8234/ + +# Message serializer, optional, implementation of `io.quarkus.reactivemessaging.http.runtime.serializers.Serializer` +mp.messaging.outgoing..serializer=com.example.MySerializer + +# The number of retries to make for sending a message to a remote websocket endpoint. +# A value greater than 0 is advised. Otherwise, a web socket timeout can result in a dropped message +# The default value is 1 +mp.messaging.outgoing..maxRetries=1 + +# Configures the random factor when using back-off with maxAttempts > 1, 0.5 by default +mp.messaging.outgoing..jitter=0.7 + +# Configures a back-off delay between attempts to send a request. +# A random factor (jitter) is applied to increase the delay when several failures happen. +mp.messaging.outgoing..delay=2s + + +# INCOMING + +# The path of the endpoint +mp.messaging.incoming..path=/my-ws-endpoint + +# Web socket endpoint buffers messages if a consumer is not able to keep up. +# This setting specifies the size of the buffer. 8 by default +mp.messaging.incoming..buffer-size=3 +---- + === Reactive Messaging This extension utilizes MicroProfile Reactive Messaging to build data streaming applications.