From fd0e46131de61816e6f29693c9fd92cc98f18cd1 Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Mon, 9 Sep 2024 10:44:44 +0200 Subject: [PATCH 01/23] Document Vert.x integration [DEX-172] --- .../architecture/pages/data-partitioning.adoc | 1 + .../integrate/pages/integrate-with-vertx.adoc | 118 +++++ .../pages/vertx-step-by-step-buide.adoc | 477 ++++++++++++++++++ 3 files changed, 596 insertions(+) create mode 100644 docs/modules/integrate/pages/integrate-with-vertx.adoc create mode 100644 docs/modules/integrate/pages/vertx-step-by-step-buide.adoc diff --git a/docs/modules/architecture/pages/data-partitioning.adoc b/docs/modules/architecture/pages/data-partitioning.adoc index e4c23a70d..7ded99527 100644 --- a/docs/modules/architecture/pages/data-partitioning.adoc +++ b/docs/modules/architecture/pages/data-partitioning.adoc @@ -201,6 +201,7 @@ Please note that `IndeterminateOperationStateException` does not apply to read-only operations, such as `map.get()`. If a partition primary replica member crashes before replying to a read-only operation, the operation is retried on the new owner of the primary replica. +[[best-effort-consistency]] === Best-Effort Consistency The replication algorithm for AP data structures enables Hazelcast clusters to offer high throughput. diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc new file mode 100644 index 000000000..596d39f7f --- /dev/null +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -0,0 +1,118 @@ += Integrate with Vert.x + +Vert.x is a reactive application toolkit for creating resource-efficient, concurrent, asynchronous and flexible application on the JVM. + +Hazelcast integrates with Vert.x in a form of a cluster manager - the link:https://vertx.io/docs/vertx-hazelcast/java/[Hazelcast Cluster Manager]. + + +In Vert.x a cluster manager is used for various functions including: + +- Discovery and group membership of Vert.x nodes in a cluster +- Maintaining cluster wide topic subscriber lists (so we know which nodes are interested in which event bus addresses) +- Distributed Map support +- Distributed Locks +- Distributed Counters + +There are 2 modules to chose from: +- `io.vertx:vertx-hazelcast` - this module is part of Vert.x and is maintained by the Vert.x team with contributions from Hazelcast developers. This module is licensed under the Apache 2 license. + +- `com.hazelcast:vertx-hazelcast-enterprise` - this module is built on top of `vertx-hazelcast` and leverages functionality of {enterprise-product-name} to implement some of the cluster manager functionality (e.g. it uses CP Subsystem to implement strongly consistent `io.vertx.core.shareddata.Lock` and `io.vertx.core.shareddata.Counter`). + +== Using Vert.x Hazelcast Enterprise Cluster Manager + +To use the Vert.x Hazelcast Enterprise Cluster Manager add the following dependency to your Vert.x application: + +[source,xml] +---- + + com.hazelcast + vertx-hazelcast-enterprise + 5.0.0-SNAPSHOT + +---- + +The dependency is located in the Hazelcast private repository, you need to add that as well: + +[source,xml] +---- + + + private-repository + Hazelcast Private Repository + https://repository.hazelcast.com/release/ + + +---- + +To enable clustering, start your Vert.x application with the `-cluster` parameter. + +=== Configuration + +Provide file named `cluster.xml` on your classpath to configure Hazelcast instance used by Vert.x. + +To take advantage of the Lock and Counter data structures backed by the CP subsystem, you need to enable the xref:cp-subsystem:cp-subsystem.adoc[CP Subsytem]. + +For other configuration methods see the link:https://vertx.io/docs/vertx-hazelcast/java/#configcluster[Vert.x documentation]. + +=== Versioning and Hazelcast compatibility + +Vert.x Hazelcast Enterprise module follows the versioning of Vertx. If you use `x.y.z` version of Vert.x you should use `x.y.z` version of `vertx-hazelcast-enteprise`. + +The `vertx-hazelcast-enteprise` module is compatible with all Hazelcast versions supported at the time of the release of the `vertx-hazelcast-enteprise` module unless stated otherwise. + +While older versions may work, such configurations are not supported. + +== Using Vert.x Hazelcast Cluster Manager + +See the Vert.x Hazelcast Cluster Manager site for reference documentation of the `vertx-hazelcast` module. + +You can also follow our xref:vertx-step-by-step-buide.adoc[step-by-step guide]. + +== Using different Hazelcast version + +Due to Java compatibility reasons the Vert.x Hazelcast module doesn't depend on the latest version of Hazelcast. +You can change the Hazelcast dependency to any version of Hazelcast you need, e.g. you can change it to Hazelcast 5.2.x for Java 8 compatibilty, or to the latest. + +NOTE: The old versions may not be supported by Hazelcast anymore and don't receive any patches. + +There are multiple ways how to replace the transitive dependency. The most reliable way is to exclude the `com.hazelcast:hazelcast` transitive dependency of the `vert-hazelcast` module and add a direct dependency on `com.hazelcast:hazelcast` to the pom.xml of your project. + +[source,xml] +---- + + io.vertx + vertx-hazelcast + + + com.hazelcast + hazelcast + + + + + com.hazelcast + hazelcast + 5.5.0 + +---- + +Similarly, for `vertx-hazelcast-enterprise`: + +[source,xml] +---- + + com.hazelcast + vertx-hazelcast-enterprise + + + com.hazelcast + hazelcast + + + + + com.hazelcast + hazelcast + 5.5.0 + +---- diff --git a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc new file mode 100644 index 000000000..f3ea8f43c --- /dev/null +++ b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc @@ -0,0 +1,477 @@ += Vert.x Hazelcast Getting Started + +This is a step-by-step guide on how to integrate Vert.x with Hazelcast and use Hazelcast for distributed session management and other distributed data structures. + +In this guide we will +- start with a simple Vert.x Hello World application +- add vertx-hazelcast module and enable distributed session management +- use `io.vertx.core.shareddata.Counter` data structure to implement a unique id generator + +== Prerequisites + +- Java 17 or newer +- Maven 3.9+ +- link:https://httpie.io[httpie] client + +== Create a new project + +1. Go to link:https://start.vertx.io[start.vertx.io], change the artifact id to `messages`, the version to 5.0.0 and generate a new project. + +2. Extract the project and build it using + +[source,bash] +---- +$ mvn clean package +---- + +and start the application using + +[source,bash] +---- +java -jar target/messages-1.0.0-SNAPSHOT-fat.jar +---- + +you should see an output similar to the following: + +[source] +---- +HTTP server started on port 8888 +Aug 29, 2024 2:22:38 PM io.vertx.launcher.application.VertxApplication +INFO: Succeeded in deploying verticle +---- + +[NOTE] +==== +TODO (should be removed when fixed before merging) + +There seems tobe a bug in 5.0.0-SNAPSHOT +change + +`io.vertx.core.Launcher` + +to + +`io.vertx.launcher.application.VertxApplication` + +END TODO +==== + +== Storing Data in Session + +Go to the `MainVerticle.java` file and replace the contents of the start method with the following: + +NOTE: This guide uses 2 space indentation, which is customary for Vertx projects due to high number of nested callbacks. + +[source,java] +---- + public void start() { + // Create a Router + Router router = router(vertx); + + // Create local SessionStore + SessionStore store = LocalSessionStore.create(vertx); + + // Use the SessionStore to handle all requests + router.route() + .handler(SessionHandler.create(store)); + + router.route(HttpMethod.PUT, "/").handler(context -> { + context.request().bodyHandler(body -> { + List messages = getMessagesFromSession(context); + + JsonObject json = body.toJsonObject(); + String message = json.getString("message"); + messages.add(message); + + putMessagesToSession(context, messages); + + context.json( + new JsonObject() + .put("messages", messages) + ); + }); + }); + + // Create the HTTP server + vertx.createHttpServer() + // Handle every request using the router + .requestHandler(router) + // Start listening + .listen(8888) + // Print the port + .onSuccess(server -> + System.out.println( + "HTTP server started on port " + server.actualPort() + ) + ); + } + + private static List getMessagesFromSession(RoutingContext context) { + String messages = context.session().get("messages"); + if (messages == null) { + return new ArrayList<>(); + } else { + return new ArrayList<>(Arrays.asList(messages.split(","))); + } + } + + private void putMessagesToSession(RoutingContext context, List messages) { + context.session().put("messages", String.join(",", messages)); + } +---- + +[source,bash] +---- +$ http put localhost:8888 message=Hello\ World! +HTTP/1.1 200 OK +content-length: 29 +content-type: application/json +set-cookie: vertx-web.session=ed22f77473a7f613c9305431a62832a6; Path=/ + +{ + "messages": [ + "Hello World!" + ] +} + +---- + +Execute another request with the cookie. + +[source,bash] +---- +$ http put localhost:8888 'Cookie:vertx-web.session=ed22f77473a7f613c9305431a62832a6' message=Hello\ World\ 2! +HTTP/1.1 200 OK +content-length: 46 +content-type: application/json + +{ + "messages": [ + "Hello World!", + "Hello World 2!" + ] +} + +---- + +== Distributed Sessions + +Let's modify the code, so we can start multiple instances easily - the application will start on defined port, and when the port is not available it will search for another port: + +Add the following method to the `MainVerticle.java` class + +[source,java] +---- + private int findFreePort(int from) { + for (int port = from; port < from + 100; port++) { + try { + new ServerSocket(port).close(); + return port; + } catch (IOException e) { + // port not available, try next + } + } + throw new RuntimeException("Could not find an available port"); + } +---- + +and use it in the `start` method: + +[source,java] +---- + ... + int port = findFreePort(8888); + + // Create the HTTP server + vertx.createHttpServer() + // Handle every request using the router + .requestHandler(router) + // Start listening + .listen(port) + ... +---- + +Now, we can start two instances: + +[source,bash] +---- +$ java -jar target/vertx-hz-1.0.0-SNAPSHOT-fat.jar +HTTP server started on port 8888 +Aug 30, 2024 9:09:44 AM io.vertx.launcher.application.VertxApplication +INFO: Succeeded in deploying verticle + +... + +$ java -jar target/vertx-hz-1.0.0-SNAPSHOT-fat.jar +HTTP server started on port 8889 +Aug 30, 2024 9:09:47 AM io.vertx.launcher.application.VertxApplication +INFO: Succeeded in deploying verticle +---- + +and we can see the session is not shared between the instances, here is the request to the first instance: + +[source, bash] +---- +$ http PUT localhost:8888 message="Hello world" +HTTP/1.1 200 OK +content-length: 28 +content-type: application/json +set-cookie: vertx-web.session=00f219c166ca50727d23eaaf9fe54229; Path=/ + +{ + "messages": [ + "Hello world" + ] +} +---- + +and here is the request to the 2nd instance, notice the different port and that we use the cookie we received, but the data does not contain the previous message. + +[source, bash] +---- +$ http PUT localhost:8889 message="Hello world 2" 'Cookie: vertx-web.session=00f219c166ca50727d23eaaf9fe54229' +HTTP/1.1 200 OK +content-length: 30 +content-type: application/json +set-cookie: vertx-web.session=a1486c5ed6416972fdc356e4d91d2397; Path=/ + +{ + "messages": [ + "Hello world 2" + ] +} +---- + +We will fix that by using a Hazelcast Cluster Manager. There are two modules that provide Hazelcast Cluster Manager: + +- `io.vertx:vertx-hazelcast` - this module is maintained by the Vert.x team, with contributions from Hazelcast, and is built on top of open-source Hazelcast +- `com.hazelcast:vertx-hazelcast-enterprise` / this module is maintained by the Hazelcast team and is built on top of the `vertx-hazelcast` but uses Hazelcast Enterprise instead. You need an enterprise license to use Hazelcast Enterprise. + +You can use either module for most of this guilde, at the end of this guide you will need the `vertx-hazelcast-enterprise` module. + +NOTE: You can get your trial key at https://hazelcast.com/get-started/ or you can use `vertx-hazelcast` and a community edition of Hazelcast. + +Add the following dependency to the `pom.xml` + +[source,xml] +---- + + com.hazelcast + vertx-hazelcast-enterprise + {vertx.version} + +---- + +change the following part of the `start` method + +[source,java] +---- +// Create local SessionStore +SessionStore store = LocalSessionStore.create(vertx); +---- + +to the following + +[source,java] +---- +// Create clustered SessionStore +SessionStore store = ClusteredSessionStore.create(vertx); +---- + +and from now on we will start the application with `-server` parameter, which tells Vert.x to look for a cluster manager implementation. + +We also need to provide Hazelcast configuration file, create a file cluster.xml in `src/main/resources` directory: + +[source,xml] +---- + + + + + replace/with/your/key + + + + + + + + + 1 + SET + + + + 1 + + + + 1 + + + + 0 + + + __vertx.* + false + 1 + + + + +---- + +Now rebuild the project and start the application, you will see more verbose output as Hazelcast prints its own startup logs: + +[source,bash] +---- +$ java -jar target/vertx-hz-1.0.0-SNAPSHOT-fat.jar -cluster +... +HTTP server started on port 8888 +... +Members {size:2, ver:2} [ + Member [192.168.0.10]:5701 - e29f0362-f9a9-4708-b6e5-1a6067b5aa39 this + Member [192.168.0.10]:5702 - 74014573-a18a-44f2-9ca7-fd90b70dcb43 +] +... +---- + +and + +[source,bash] +---- +$ java -jar target/vertx-hz-1.0.0-SNAPSHOT-fat.jar -cluster +... +HTTP server started on port 8889 +... +Members {size:2, ver:2} [ + Member [192.168.0.10]:5701 - e29f0362-f9a9-4708-b6e5-1a6067b5aa39 + Member [192.168.0.10]:5702 - 74014573-a18a-44f2-9ca7-fd90b70dcb43 this +] +... +---- + +putting two messages into different instances while using the same cookie we see that the session is shared between the instances. + +[source,bash] +---- +$ http PUT localhost:8888 message="Hello world" +HTTP/1.1 200 OK +content-length: 31 +content-type: application/json +set-cookie: vertx-web.session=1ab47cb96731123135f25ec7b67efd64; Path=/ + +{ + "messages": [ + "", + "Hello world" + ] +} +---- + +[source,bash] +---- +$ http PUT localhost:8889 message="Hello world 2" 'Cookie: vertx-web.session=674806546c690674962f279670abefcf' +HTTP/1.1 200 OK +content-length: 44 +content-type: application/json + +{ + "messages": [ + "Hello world", + "Hello world 2" + ] +} +---- + +== Using Counter + +Replace this part of the code at the end of the `start()` method + +[source,java] +---- +context.json( + new JsonObject() + .put("messages", messages) +); +---- + +with the following + +[source,java] +---- +context.vertx() + .sharedData() + .getCounter("requestId") + .onSuccess(counter -> { + counter.incrementAndGet() + .onSuccess(requestId -> { + context.json( + new JsonObject() + .put("requestId", requestId) + .put("messages", messages) + ); + }); + }); +---- + +when you try the application now you can see the response contains additional field named `requestId` and its value increments every for every request + +[source,bash] +---- +$ http PUT localhost:8888 message="Hello world" +HTTP/1.1 200 OK +content-length: 42 +content-type: application/json +set-cookie: vertx-web.session=d9fb4cada5c0fc625089a38f3de13e3c; Path=/ + +{ + "messages": [ + "Hello world" + ], + "requestId": 1 +} +---- + +== CP Subsystem backed Lock and Counter + +The module `vertx-hazelcast-enterprise` provides a different implementation of the `io.vertx.core.shareddata.Counter` and `io.vertx.core.shareddata.Lock` data structures. The implementation in `vertx-hazelcast` is based on the IMap data structure and provides guarantees defined in the xref:architecture:data-partitioning.adoc#best-effort-consistency[Best-effort consistency] section. This means that under certain network partition conditions the counter doesn't provide strong consistency guarantees and can generate duplicate values. + +The module `vertx-hazelcast-enterprise` uses the CP Subsystem from {enterprise-product-name} to implement the Lock and Counter. + +NOTE: For the rest of this guide you need to have an {enterprise-product-name} license. + +Make sure you have the following dependency + +[source,xml] +---- + + com.hazelcast + vertx-hazelcast-enterprise + {vertx.version} + +---- + +and your XML config contains a valid license key: + +[source,xml] +---- +... + replace/with/your/key +... +---- + +enable the CP subsystem, in cluster.xml change the value of the `` property to `3`: + +[source,xml] +---- + 3 +---- + +You need to start at least 3 instances for the cluster to form successfully. For complete documentation see the xref:cp-subsystem:cp-subsystem.adoc[CP Subsystem] section. + + From fe429238f56bf7320b4046004ec562d21ae49ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:03:52 +0200 Subject: [PATCH 02/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 596d39f7f..f16e97de5 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -1,6 +1,6 @@ = Integrate with Vert.x -Vert.x is a reactive application toolkit for creating resource-efficient, concurrent, asynchronous and flexible application on the JVM. +Vert.x is a reactive application toolkit for creating resource-efficient, concurrent, asynchronous and flexible applications on the JVM. Hazelcast integrates with Vert.x in a form of a cluster manager - the link:https://vertx.io/docs/vertx-hazelcast/java/[Hazelcast Cluster Manager]. From 36fba0099d6392a77aaa3ab8a341e3f4773470da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:04:01 +0200 Subject: [PATCH 03/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index f16e97de5..3ee201ead 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -13,7 +13,7 @@ In Vert.x a cluster manager is used for various functions including: - Distributed Locks - Distributed Counters -There are 2 modules to chose from: +There are 2 modules to choose from: - `io.vertx:vertx-hazelcast` - this module is part of Vert.x and is maintained by the Vert.x team with contributions from Hazelcast developers. This module is licensed under the Apache 2 license. - `com.hazelcast:vertx-hazelcast-enterprise` - this module is built on top of `vertx-hazelcast` and leverages functionality of {enterprise-product-name} to implement some of the cluster manager functionality (e.g. it uses CP Subsystem to implement strongly consistent `io.vertx.core.shareddata.Lock` and `io.vertx.core.shareddata.Counter`). From a50ac28421b855be01293d708063595b8e980ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:04:10 +0200 Subject: [PATCH 04/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 3ee201ead..2a4ab0feb 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -8,7 +8,7 @@ Hazelcast integrates with Vert.x in a form of a cluster manager - the link:https In Vert.x a cluster manager is used for various functions including: - Discovery and group membership of Vert.x nodes in a cluster -- Maintaining cluster wide topic subscriber lists (so we know which nodes are interested in which event bus addresses) +- Maintaining cluster-wide topic subscriber lists (so we know which nodes are interested in which event bus addresses) - Distributed Map support - Distributed Locks - Distributed Counters From 2bd46fde4e6608315c65846a00dc8d2c736c97c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:08:37 +0200 Subject: [PATCH 05/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 2a4ab0feb..1edd31c8a 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -16,7 +16,7 @@ In Vert.x a cluster manager is used for various functions including: There are 2 modules to choose from: - `io.vertx:vertx-hazelcast` - this module is part of Vert.x and is maintained by the Vert.x team with contributions from Hazelcast developers. This module is licensed under the Apache 2 license. -- `com.hazelcast:vertx-hazelcast-enterprise` - this module is built on top of `vertx-hazelcast` and leverages functionality of {enterprise-product-name} to implement some of the cluster manager functionality (e.g. it uses CP Subsystem to implement strongly consistent `io.vertx.core.shareddata.Lock` and `io.vertx.core.shareddata.Counter`). +- `com.hazelcast:vertx-hazelcast-enterprise` - this module is built on top of `vertx-hazelcast` and leverages functionality of {enterprise-product-name} to implement some of the cluster manager functionality (e.g. it uses the CP Subsystem to implement strongly consistent `io.vertx.core.shareddata.Lock` and `io.vertx.core.shareddata.Counter`). == Using Vert.x Hazelcast Enterprise Cluster Manager From 0513b2f79f013d4aa67aa51c32b473e7c38b83ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:08:46 +0200 Subject: [PATCH 06/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 1edd31c8a..02321e293 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -20,7 +20,7 @@ There are 2 modules to choose from: == Using Vert.x Hazelcast Enterprise Cluster Manager -To use the Vert.x Hazelcast Enterprise Cluster Manager add the following dependency to your Vert.x application: +To use the Vert.x Hazelcast Enterprise Cluster Manager, add the following dependency to your Vert.x application: [source,xml] ---- From 4b47f051c97f1ef461d94bca3a5ae352468006d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:08:52 +0200 Subject: [PATCH 07/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 02321e293..6bf2fb501 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -48,7 +48,7 @@ To enable clustering, start your Vert.x application with the `-cluster` paramete === Configuration -Provide file named `cluster.xml` on your classpath to configure Hazelcast instance used by Vert.x. +Provide a file named `cluster.xml` on your classpath to configure a Hazelcast instance used by Vert.x. To take advantage of the Lock and Counter data structures backed by the CP subsystem, you need to enable the xref:cp-subsystem:cp-subsystem.adoc[CP Subsytem]. From f85bf7ae70e1f16be3054b2ab2221d84ee912201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:08:59 +0200 Subject: [PATCH 08/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 6bf2fb501..f71f2f757 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -31,7 +31,7 @@ To use the Vert.x Hazelcast Enterprise Cluster Manager, add the following depend ---- -The dependency is located in the Hazelcast private repository, you need to add that as well: +The dependency is located in the Hazelcast private repository, and you need to add that as well: [source,xml] ---- From a2dd4ef3f841636e35e80a20451914d833ada9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:09:06 +0200 Subject: [PATCH 09/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index f71f2f757..76748b09d 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -56,7 +56,7 @@ For other configuration methods see the link:https://vertx.io/docs/vertx-hazelca === Versioning and Hazelcast compatibility -Vert.x Hazelcast Enterprise module follows the versioning of Vertx. If you use `x.y.z` version of Vert.x you should use `x.y.z` version of `vertx-hazelcast-enteprise`. +The Vert.x Hazelcast Enterprise module follows the versioning of Vertx. If you use an `x.y.z` version of Vert.x, you should use an `x.y.z` version of `vertx-hazelcast-enteprise`. The `vertx-hazelcast-enteprise` module is compatible with all Hazelcast versions supported at the time of the release of the `vertx-hazelcast-enteprise` module unless stated otherwise. From 3848caf8fd399f8b7f7919bb5b7d71abe3983500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:09:36 +0200 Subject: [PATCH 10/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 76748b09d..74319e3f2 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -68,7 +68,7 @@ See the Vert.x Hazelcast Cluster Manager site for reference documentation of the You can also follow our xref:vertx-step-by-step-buide.adoc[step-by-step guide]. -== Using different Hazelcast version +== Using a different Hazelcast version Due to Java compatibility reasons the Vert.x Hazelcast module doesn't depend on the latest version of Hazelcast. You can change the Hazelcast dependency to any version of Hazelcast you need, e.g. you can change it to Hazelcast 5.2.x for Java 8 compatibilty, or to the latest. From f98a0914b7ca5a1199cf48fb6e0ce512f532f816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:09:44 +0200 Subject: [PATCH 11/23] Update docs/modules/integrate/pages/integrate-with-vertx.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 74319e3f2..0505203cb 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -75,7 +75,7 @@ You can change the Hazelcast dependency to any version of Hazelcast you need, e. NOTE: The old versions may not be supported by Hazelcast anymore and don't receive any patches. -There are multiple ways how to replace the transitive dependency. The most reliable way is to exclude the `com.hazelcast:hazelcast` transitive dependency of the `vert-hazelcast` module and add a direct dependency on `com.hazelcast:hazelcast` to the pom.xml of your project. +There are multiple ways to replace the transitive dependency. The most reliable way is to exclude the `com.hazelcast:hazelcast` transitive dependency of the `vert-hazelcast` module and add a direct dependency on `com.hazelcast:hazelcast` to the pom.xml of your project. [source,xml] ---- From 675b663418f4e69d84d00c2b8642f692fe367d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:09:58 +0200 Subject: [PATCH 12/23] Update docs/modules/integrate/pages/vertx-step-by-step-buide.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/vertx-step-by-step-buide.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc index f3ea8f43c..7009f87a7 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc @@ -15,7 +15,7 @@ In this guide we will == Create a new project -1. Go to link:https://start.vertx.io[start.vertx.io], change the artifact id to `messages`, the version to 5.0.0 and generate a new project. +1. Go to link:https://start.vertx.io[start.vertx.io], change the artifact id to `messages`, the version to 5.0.0, and generate a new project. 2. Extract the project and build it using From 5f988b93bf5f0334b33bb32693f4957081d18849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:10:05 +0200 Subject: [PATCH 13/23] Update docs/modules/integrate/pages/vertx-step-by-step-buide.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/vertx-step-by-step-buide.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc index 7009f87a7..55f11e10e 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc @@ -24,7 +24,7 @@ In this guide we will $ mvn clean package ---- -and start the application using +and start the application using: [source,bash] ---- From f18b2f6dde196ea0bad8bd94c5b52fdb89069ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:10:31 +0200 Subject: [PATCH 14/23] Update docs/modules/integrate/pages/vertx-step-by-step-buide.adoc Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/vertx-step-by-step-buide.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc index 55f11e10e..94965f286 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc @@ -472,6 +472,6 @@ enable the CP subsystem, in cluster.xml change the value of the `` property to ` 3 ---- -You need to start at least 3 instances for the cluster to form successfully. For complete documentation see the xref:cp-subsystem:cp-subsystem.adoc[CP Subsystem] section. +You need to start at least 3 instances for the cluster to form successfully. For complete documentation, see the xref:cp-subsystem:cp-subsystem.adoc[CP Subsystem] section. From 9afd2fa2b96c4a5dc04abb4a1b9f12dec7c02d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Fri, 13 Sep 2024 15:11:14 +0200 Subject: [PATCH 15/23] Apply suggestions from code review Co-authored-by: Amanda Lindsay --- .../pages/vertx-step-by-step-buide.adoc | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc index 94965f286..c066d96bf 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc @@ -17,7 +17,7 @@ In this guide we will 1. Go to link:https://start.vertx.io[start.vertx.io], change the artifact id to `messages`, the version to 5.0.0, and generate a new project. -2. Extract the project and build it using +2. Extract the project and build it using: [source,bash] ---- @@ -60,7 +60,7 @@ END TODO Go to the `MainVerticle.java` file and replace the contents of the start method with the following: -NOTE: This guide uses 2 space indentation, which is customary for Vertx projects due to high number of nested callbacks. +NOTE: This guide uses 2 space indentation, which is customary for Vertx projects due to the high number of nested callbacks. [source,java] ---- @@ -156,9 +156,9 @@ content-type: application/json == Distributed Sessions -Let's modify the code, so we can start multiple instances easily - the application will start on defined port, and when the port is not available it will search for another port: +Let's modify the code, so we can start multiple instances easily - the application will start on the defined port, and when the port is not available it will search for another port: -Add the following method to the `MainVerticle.java` class +Add the following method to the `MainVerticle.java` class: [source,java] ---- @@ -208,7 +208,7 @@ Aug 30, 2024 9:09:47 AM io.vertx.launcher.application.VertxApplication INFO: Succeeded in deploying verticle ---- -and we can see the session is not shared between the instances, here is the request to the first instance: +and we can see the session is not shared between the instances. Here is the request to the first instance: [source, bash] ---- @@ -225,7 +225,7 @@ set-cookie: vertx-web.session=00f219c166ca50727d23eaaf9fe54229; Path=/ } ---- -and here is the request to the 2nd instance, notice the different port and that we use the cookie we received, but the data does not contain the previous message. +and here is the request to the 2nd instance. Notice the different port and that we use the cookie we received, but the data does not contain the previous message. [source, bash] ---- @@ -247,7 +247,7 @@ We will fix that by using a Hazelcast Cluster Manager. There are two modules tha - `io.vertx:vertx-hazelcast` - this module is maintained by the Vert.x team, with contributions from Hazelcast, and is built on top of open-source Hazelcast - `com.hazelcast:vertx-hazelcast-enterprise` / this module is maintained by the Hazelcast team and is built on top of the `vertx-hazelcast` but uses Hazelcast Enterprise instead. You need an enterprise license to use Hazelcast Enterprise. -You can use either module for most of this guilde, at the end of this guide you will need the `vertx-hazelcast-enterprise` module. +You can use either module for most of this guide. At the end of this guide you will need the `vertx-hazelcast-enterprise` module. NOTE: You can get your trial key at https://hazelcast.com/get-started/ or you can use `vertx-hazelcast` and a community edition of Hazelcast. @@ -280,7 +280,7 @@ SessionStore store = ClusteredSessionStore.create(vertx); and from now on we will start the application with `-server` parameter, which tells Vert.x to look for a cluster manager implementation. -We also need to provide Hazelcast configuration file, create a file cluster.xml in `src/main/resources` directory: +We also need to provide a Hazelcast configuration file, and create a file cluster.xml in the `src/main/resources` directory: [source,xml] ---- @@ -325,7 +325,7 @@ We also need to provide Hazelcast configuration file, create a file cluster.xml ---- -Now rebuild the project and start the application, you will see more verbose output as Hazelcast prints its own startup logs: +Now rebuild the project and start the application. You will see more verbose output as Hazelcast prints its own startup logs: [source,bash] ---- @@ -419,7 +419,7 @@ context.vertx() }); ---- -when you try the application now you can see the response contains additional field named `requestId` and its value increments every for every request +when you now try the application, you can see the response contains an additional field named `requestId` and its value increments for every request [source,bash] ---- @@ -465,7 +465,7 @@ and your XML config contains a valid license key: ... ---- -enable the CP subsystem, in cluster.xml change the value of the `` property to `3`: +enable the CP subsystem, and in cluster.xml change the value of the `` property to `3`: [source,xml] ---- From f03657493668870c715ecb4ce5636147dd091ef6 Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Fri, 13 Sep 2024 15:11:49 +0200 Subject: [PATCH 16/23] Fix typo in file name --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- ...tx-step-by-step-buide.adoc => vertx-step-by-step-guide.adoc} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/modules/integrate/pages/{vertx-step-by-step-buide.adoc => vertx-step-by-step-guide.adoc} (100%) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 0505203cb..1f6ea7192 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -66,7 +66,7 @@ While older versions may work, such configurations are not supported. See the Vert.x Hazelcast Cluster Manager site for reference documentation of the `vertx-hazelcast` module. -You can also follow our xref:vertx-step-by-step-buide.adoc[step-by-step guide]. +You can also follow our xref:vertx-step-by-step-guide.adoc[step-by-step guide]. == Using a different Hazelcast version diff --git a/docs/modules/integrate/pages/vertx-step-by-step-buide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc similarity index 100% rename from docs/modules/integrate/pages/vertx-step-by-step-buide.adoc rename to docs/modules/integrate/pages/vertx-step-by-step-guide.adoc From 62101ff591530609972dd2e28a4f76d7822e6cbb Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Fri, 13 Sep 2024 15:20:00 +0200 Subject: [PATCH 17/23] Address review comments --- .../pages/vertx-step-by-step-guide.adoc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc index c066d96bf..3a2a76e85 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc @@ -136,7 +136,7 @@ set-cookie: vertx-web.session=ed22f77473a7f613c9305431a62832a6; Path=/ ---- -Execute another request with the cookie. +Execute another request with the cookie: [source,bash] ---- @@ -245,13 +245,13 @@ set-cookie: vertx-web.session=a1486c5ed6416972fdc356e4d91d2397; Path=/ We will fix that by using a Hazelcast Cluster Manager. There are two modules that provide Hazelcast Cluster Manager: - `io.vertx:vertx-hazelcast` - this module is maintained by the Vert.x team, with contributions from Hazelcast, and is built on top of open-source Hazelcast -- `com.hazelcast:vertx-hazelcast-enterprise` / this module is maintained by the Hazelcast team and is built on top of the `vertx-hazelcast` but uses Hazelcast Enterprise instead. You need an enterprise license to use Hazelcast Enterprise. +- `com.hazelcast:vertx-hazelcast-enterprise` - this module is maintained by the Hazelcast team and is built on top of the `vertx-hazelcast` but uses Hazelcast Enterprise instead. You need an enterprise license to use Hazelcast Enterprise. You can use either module for most of this guide. At the end of this guide you will need the `vertx-hazelcast-enterprise` module. NOTE: You can get your trial key at https://hazelcast.com/get-started/ or you can use `vertx-hazelcast` and a community edition of Hazelcast. -Add the following dependency to the `pom.xml` +Add the following dependency to the `pom.xml`: [source,xml] ---- @@ -262,7 +262,7 @@ Add the following dependency to the `pom.xml` ---- -change the following part of the `start` method +change the following part of the `start` method: [source,java] ---- @@ -270,7 +270,7 @@ change the following part of the `start` method SessionStore store = LocalSessionStore.create(vertx); ---- -to the following +to the following: [source,java] ---- @@ -390,7 +390,7 @@ content-type: application/json == Using Counter -Replace this part of the code at the end of the `start()` method +Replace this part of the code at the end of the `start()` method: [source,java] ---- @@ -400,7 +400,7 @@ context.json( ); ---- -with the following +with the following: [source,java] ---- @@ -419,7 +419,7 @@ context.vertx() }); ---- -when you now try the application, you can see the response contains an additional field named `requestId` and its value increments for every request +When you now try the application, you can see the response contains an additional field named `requestId` and its value increments for every request. [source,bash] ---- @@ -445,7 +445,7 @@ The module `vertx-hazelcast-enterprise` uses the CP Subsystem from {enterprise-p NOTE: For the rest of this guide you need to have an {enterprise-product-name} license. -Make sure you have the following dependency +Make sure you have the following dependency: [source,xml] ---- @@ -474,4 +474,3 @@ enable the CP subsystem, and in cluster.xml change the value of the `` property You need to start at least 3 instances for the cluster to form successfully. For complete documentation, see the xref:cp-subsystem:cp-subsystem.adoc[CP Subsystem] section. - From b0e3bca15afc3be86e9b170ed39a595b0a5732cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Wed, 2 Oct 2024 13:56:09 +0200 Subject: [PATCH 18/23] Update docs/modules/integrate/pages/vertx-step-by-step-guide.adoc Co-authored-by: Oliver Howell --- docs/modules/integrate/pages/vertx-step-by-step-guide.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc index 3a2a76e85..514a376ce 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc @@ -1,4 +1,4 @@ -= Vert.x Hazelcast Getting Started += Get started with Vert.x This is a step-by-step guide on how to integrate Vert.x with Hazelcast and use Hazelcast for distributed session management and other distributed data structures. From a121a33da645af7a67d336e03b355a0093b55dc5 Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Wed, 2 Oct 2024 13:59:01 +0200 Subject: [PATCH 19/23] Add snapshot repository to docs --- .../integrate/pages/integrate-with-vertx.adoc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 1f6ea7192..b71a02101 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -37,13 +37,26 @@ The dependency is located in the Hazelcast private repository, and you need to a ---- - private-repository + hazelcast-private-repository Hazelcast Private Repository https://repository.hazelcast.com/release/ ---- +Alternatively, if you need to use a snapshot version: + +[source,xml] +---- + + + hazelcast-private-snapshot-repository + Hazelcast Private Snapshot Repository + https://repository.hazelcast.com/snapshot/ + + +---- + To enable clustering, start your Vert.x application with the `-cluster` parameter. === Configuration From 862969bb4227851b0ccd528f1ea5a8cc35e0517d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hartman?= Date: Thu, 17 Oct 2024 13:43:55 +0200 Subject: [PATCH 20/23] Apply suggestions from code review Co-authored-by: Amanda Lindsay --- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- .../integrate/pages/vertx-step-by-step-guide.adoc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index b71a02101..36ffc557a 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -77,7 +77,7 @@ While older versions may work, such configurations are not supported. == Using Vert.x Hazelcast Cluster Manager -See the Vert.x Hazelcast Cluster Manager site for reference documentation of the `vertx-hazelcast` module. +See the Vert.x Hazelcast Cluster Manager site for reference documentation for the `vertx-hazelcast` module. You can also follow our xref:vertx-step-by-step-guide.adoc[step-by-step guide]. diff --git a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc index 514a376ce..150733385 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc @@ -31,7 +31,7 @@ and start the application using: java -jar target/messages-1.0.0-SNAPSHOT-fat.jar ---- -you should see an output similar to the following: +You should see output similar to the following: [source] ---- @@ -60,7 +60,7 @@ END TODO Go to the `MainVerticle.java` file and replace the contents of the start method with the following: -NOTE: This guide uses 2 space indentation, which is customary for Vertx projects due to the high number of nested callbacks. +NOTE: This guide uses 2-space indentation, which is customary for Vertx projects due to the high number of nested callbacks. [source,java] ---- @@ -262,7 +262,7 @@ Add the following dependency to the `pom.xml`: ---- -change the following part of the `start` method: +Change the following part of the `start` method: [source,java] ---- @@ -355,7 +355,7 @@ Members {size:2, ver:2} [ ... ---- -putting two messages into different instances while using the same cookie we see that the session is shared between the instances. +Putting two messages into different instances while using the same cookie, we see that the session is shared between the instances. [source,bash] ---- @@ -465,7 +465,7 @@ and your XML config contains a valid license key: ... ---- -enable the CP subsystem, and in cluster.xml change the value of the `` property to `3`: +Enable the CP subsystem, and in cluster.xml change the value of the `` property to `3`: [source,xml] ---- From a823ea70527b2573a358d0d304092764df12a677 Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Thu, 17 Oct 2024 13:47:38 +0200 Subject: [PATCH 21/23] Remove TODO --- .../pages/vertx-step-by-step-guide.adoc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc index 150733385..f90105fa7 100644 --- a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc +++ b/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc @@ -40,22 +40,6 @@ Aug 29, 2024 2:22:38 PM io.vertx.launcher.application.VertxApplication INFO: Succeeded in deploying verticle ---- -[NOTE] -==== -TODO (should be removed when fixed before merging) - -There seems tobe a bug in 5.0.0-SNAPSHOT -change - -`io.vertx.core.Launcher` - -to - -`io.vertx.launcher.application.VertxApplication` - -END TODO -==== - == Storing Data in Session Go to the `MainVerticle.java` file and replace the contents of the start method with the following: From f2a27287d8e868cb866cbd1d6aa1d4a191c14283 Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Thu, 17 Oct 2024 13:49:53 +0200 Subject: [PATCH 22/23] Rename guide --- ...tep-by-step-guide.adoc => get-started-with-vertx-guide.adoc} | 0 docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docs/modules/integrate/pages/{vertx-step-by-step-guide.adoc => get-started-with-vertx-guide.adoc} (100%) diff --git a/docs/modules/integrate/pages/vertx-step-by-step-guide.adoc b/docs/modules/integrate/pages/get-started-with-vertx-guide.adoc similarity index 100% rename from docs/modules/integrate/pages/vertx-step-by-step-guide.adoc rename to docs/modules/integrate/pages/get-started-with-vertx-guide.adoc diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index 36ffc557a..c41984e58 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -79,7 +79,7 @@ While older versions may work, such configurations are not supported. See the Vert.x Hazelcast Cluster Manager site for reference documentation for the `vertx-hazelcast` module. -You can also follow our xref:vertx-step-by-step-guide.adoc[step-by-step guide]. +You can also follow our xref:get-started-with-vertx-guide.adoc[Get started with Vert.x guide]. == Using a different Hazelcast version From 5961b5cb5570a9b6f7a943b824e3f62329a5cdac Mon Sep 17 00:00:00 2001 From: Frantisek Hartman Date: Thu, 17 Oct 2024 14:24:51 +0200 Subject: [PATCH 23/23] Address review comments --- docs/modules/ROOT/nav.adoc | 2 ++ ...th-vertx-guide.adoc => get-started-with-vertx.adoc} | 10 +++++----- docs/modules/integrate/pages/integrate-with-vertx.adoc | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) rename docs/modules/integrate/pages/{get-started-with-vertx-guide.adoc => get-started-with-vertx.adoc} (95%) diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 758fba3e1..92bdef261 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -184,6 +184,8 @@ include::wan:partial$nav.adoc[] ** xref:integrate:feast-config.adoc[] ** xref:integrate:feature-engineering-with-feast.adoc[Get started with Feast batch features] ** xref:integrate:streaming-features-with-feast.adoc[Get started with Feast streaming features] +* xref:integrate:integrate-with-vertx.adoc[] +** xref:integrate:get-started-with-vertx.adoc[] // Connectors * Messaging System Connectors * xref:integrate:messaging-system-connectors.adoc[Overview] diff --git a/docs/modules/integrate/pages/get-started-with-vertx-guide.adoc b/docs/modules/integrate/pages/get-started-with-vertx.adoc similarity index 95% rename from docs/modules/integrate/pages/get-started-with-vertx-guide.adoc rename to docs/modules/integrate/pages/get-started-with-vertx.adoc index f90105fa7..62cd89daf 100644 --- a/docs/modules/integrate/pages/get-started-with-vertx-guide.adoc +++ b/docs/modules/integrate/pages/get-started-with-vertx.adoc @@ -1,8 +1,8 @@ = Get started with Vert.x -This is a step-by-step guide on how to integrate Vert.x with Hazelcast and use Hazelcast for distributed session management and other distributed data structures. +This tutorial helps you integrate Vert.x with Hazelcast and use Hazelcast for distributed session management and other distributed data structures. -In this guide we will +In this tutorial, you will - start with a simple Vert.x Hello World application - add vertx-hazelcast module and enable distributed session management - use `io.vertx.core.shareddata.Counter` data structure to implement a unique id generator @@ -44,7 +44,7 @@ INFO: Succeeded in deploying verticle Go to the `MainVerticle.java` file and replace the contents of the start method with the following: -NOTE: This guide uses 2-space indentation, which is customary for Vertx projects due to the high number of nested callbacks. +NOTE: This tutorial uses 2-space indentation, which is customary for Vertx projects due to the high number of nested callbacks. [source,java] ---- @@ -231,7 +231,7 @@ We will fix that by using a Hazelcast Cluster Manager. There are two modules tha - `io.vertx:vertx-hazelcast` - this module is maintained by the Vert.x team, with contributions from Hazelcast, and is built on top of open-source Hazelcast - `com.hazelcast:vertx-hazelcast-enterprise` - this module is maintained by the Hazelcast team and is built on top of the `vertx-hazelcast` but uses Hazelcast Enterprise instead. You need an enterprise license to use Hazelcast Enterprise. -You can use either module for most of this guide. At the end of this guide you will need the `vertx-hazelcast-enterprise` module. +You can use either module for most of this tutorial. At the end of this tutorial you will need the `vertx-hazelcast-enterprise` module. NOTE: You can get your trial key at https://hazelcast.com/get-started/ or you can use `vertx-hazelcast` and a community edition of Hazelcast. @@ -427,7 +427,7 @@ The module `vertx-hazelcast-enterprise` provides a different implementation of t The module `vertx-hazelcast-enterprise` uses the CP Subsystem from {enterprise-product-name} to implement the Lock and Counter. -NOTE: For the rest of this guide you need to have an {enterprise-product-name} license. +NOTE: For the rest of this tutorial you need to have an {enterprise-product-name} license. Make sure you have the following dependency: diff --git a/docs/modules/integrate/pages/integrate-with-vertx.adoc b/docs/modules/integrate/pages/integrate-with-vertx.adoc index c41984e58..8c1bea104 100644 --- a/docs/modules/integrate/pages/integrate-with-vertx.adoc +++ b/docs/modules/integrate/pages/integrate-with-vertx.adoc @@ -79,7 +79,7 @@ While older versions may work, such configurations are not supported. See the Vert.x Hazelcast Cluster Manager site for reference documentation for the `vertx-hazelcast` module. -You can also follow our xref:get-started-with-vertx-guide.adoc[Get started with Vert.x guide]. +You can also follow our xref:get-started-with-vertx.adoc[Get started with Vert.x guide]. == Using a different Hazelcast version