You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2021/11/23 13:09:17 UTC

[camel-quarkus] 01/02: Document that vertx-websocket consumers run on the Quarkus Vert.x web server

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 886b58a0764379642f27bcaca488f667683dba36
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Nov 23 10:29:14 2021 +0000

    Document that vertx-websocket consumers run on the Quarkus Vert.x web server
    
    Fixes #3318
---
 .../reference/extensions/vertx-websocket.adoc      | 38 +++++++++++++++++++++-
 .../runtime/src/main/doc/configuration.adoc        | 12 +++++++
 .../runtime/src/main/doc/intro.adoc                |  3 ++
 .../runtime/src/main/doc/usage.adoc                | 13 ++++++++
 .../vertx/websocket/VertxWebsocketRecorder.java    |  2 +-
 5 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/docs/modules/ROOT/pages/reference/extensions/vertx-websocket.adoc b/docs/modules/ROOT/pages/reference/extensions/vertx-websocket.adoc
index 46d8b72..c3d23f0 100644
--- a/docs/modules/ROOT/pages/reference/extensions/vertx-websocket.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/vertx-websocket.adoc
@@ -14,7 +14,10 @@
 [.badges]
 [.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native since##[.badge-supported]##1.1.0##
 
-Camel WebSocket support with Vert.x
+This extension enables you to create WebSocket endpoints to that act as either a WebSocket server, or as a client to connect an existing WebSocket .
+
+It is built on top of the Eclipse Vert.x HTTP server provided by the `quarkus-vertx-http` extension.
+
 
 == What's inside
 
@@ -37,3 +40,36 @@ Or add the coordinates to your existing project:
 ----
 
 Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== Usage
+
+=== Vert.x WebSocket consumers
+
+When you create a Vert.x WebSocket consumer (E.g with `from("vertx-websocket")`), the host and port configuration in the URI are redundant since the WebSocket will always be hosted on 
+the Quarkus HTTP server.
+
+The configuration of the consumer can be simplified to only include the resource path of the WebSocket. For example.
+
+[source,java]
+----
+from("vertx-websocket://my-websocket-path")
+    .setBody().constant("Hello World");
+----
+
+
+
+== Additional Camel Quarkus configuration
+
+=== Vert.x WebSocket server configuration
+
+Configuration of the Vert.x WebSocket server is managed by Quarkus. Refer to the https://quarkus.io/guides/all-config#quarkus-vertx-http_quarkus-vertx-http-eclipse-vert.x-http[Quarkus HTTP configuration guide]
+for the full list of configuration options.
+
+To configure SSL for the Vert.x WebSocket server, follow the https://quarkus.io/guides/http-reference#ssl[secure connections with SSL guide].
+Note that configuring the server for SSL with `SSLContextParameters` is not currently supported.
+
+=== Character encodings
+
+Check the xref:user-guide/native-mode.adoc#charsets[Character encodings section] of the Native mode guide if you expect
+your application to send or receive requests using non-default encodings.
+
diff --git a/extensions/vertx-websocket/runtime/src/main/doc/configuration.adoc b/extensions/vertx-websocket/runtime/src/main/doc/configuration.adoc
new file mode 100644
index 0000000..cadf02c
--- /dev/null
+++ b/extensions/vertx-websocket/runtime/src/main/doc/configuration.adoc
@@ -0,0 +1,12 @@
+=== Vert.x WebSocket server configuration
+
+Configuration of the Vert.x WebSocket server is managed by Quarkus. Refer to the https://quarkus.io/guides/all-config#quarkus-vertx-http_quarkus-vertx-http-eclipse-vert.x-http[Quarkus HTTP configuration guide]
+for the full list of configuration options.
+
+To configure SSL for the Vert.x WebSocket server, follow the https://quarkus.io/guides/http-reference#ssl[secure connections with SSL guide].
+Note that configuring the server for SSL with `SSLContextParameters` is not currently supported.
+
+=== Character encodings
+
+Check the xref:user-guide/native-mode.adoc#charsets[Character encodings section] of the Native mode guide if you expect
+your application to send or receive requests using non-default encodings.
diff --git a/extensions/vertx-websocket/runtime/src/main/doc/intro.adoc b/extensions/vertx-websocket/runtime/src/main/doc/intro.adoc
new file mode 100644
index 0000000..4eefc4a
--- /dev/null
+++ b/extensions/vertx-websocket/runtime/src/main/doc/intro.adoc
@@ -0,0 +1,3 @@
+This extension enables you to create WebSocket endpoints to that act as either a WebSocket server, or as a client to connect an existing WebSocket .
+
+It is built on top of the Eclipse Vert.x HTTP server provided by the `quarkus-vertx-http` extension.
\ No newline at end of file
diff --git a/extensions/vertx-websocket/runtime/src/main/doc/usage.adoc b/extensions/vertx-websocket/runtime/src/main/doc/usage.adoc
new file mode 100644
index 0000000..e1e0644
--- /dev/null
+++ b/extensions/vertx-websocket/runtime/src/main/doc/usage.adoc
@@ -0,0 +1,13 @@
+=== Vert.x WebSocket consumers
+
+When you create a Vert.x WebSocket consumer (E.g with `from("vertx-websocket")`), the host and port configuration in the URI are redundant since the WebSocket will always be hosted on 
+the Quarkus HTTP server.
+
+The configuration of the consumer can be simplified to only include the resource path of the WebSocket. For example.
+
+[source,java]
+----
+from("vertx-websocket://my-websocket-path")
+    .setBody().constant("Hello World");
+----
+
diff --git a/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java b/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java
index 8f37b81..0d35db7 100644
--- a/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java
+++ b/extensions/vertx-websocket/runtime/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/VertxWebsocketRecorder.java
@@ -55,7 +55,7 @@ public class VertxWebsocketRecorder {
 
         @Override
         public void start() throws InterruptedException, ExecutionException {
-            // Noop as quarkus-vertx-web handles the server lifecycle
+            // Noop as quarkus-vertx-http handles the server lifecycle
         }
     }
 }