diff --git a/.github/workflows/quickstart_messaging-clustering-singleton_ci.yml b/.github/workflows/quickstart_messaging-clustering-singleton_ci.yml new file mode 100644 index 0000000000..e49daf2acd --- /dev/null +++ b/.github/workflows/quickstart_messaging-clustering-singleton_ci.yml @@ -0,0 +1,14 @@ +name: WildFly messaging-clustering-singleton Quickstart CI + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths: + - 'messaging-clustering-singleton/**' + - '.github/workflows/quickstart_ci.yml' +jobs: + call-quickstart_ci: + uses: ./.github/workflows/quickstart_ci.yml + with: + QUICKSTART_PATH: messaging-clustering-singleton + TEST_PROVISIONED_SERVER: true diff --git a/messaging-clustering-singleton/README-source.adoc b/messaging-clustering-singleton/README-source.adoc index 1052023a16..3be9d251b0 100644 --- a/messaging-clustering-singleton/README-source.adoc +++ b/messaging-clustering-singleton/README-source.adoc @@ -48,14 +48,26 @@ Here, you can see that only one of the MDBs, `HelloWorldTopicMDB`, is associated If a delivery group is used in conjunction with singleton, as is the case of this quickstart, the MDB will be active in the singleton provider node only if that node has `delivery-group` enabled. If not, the MDB will be inactive in that node and all remainder nodes of the cluster. +//************************************************* +// Product Release content only +//************************************************* + + // Link to the quickstart source include::../shared-doc/view-the-source.adoc[leveloffset=+1] + +== Running the Quickstart + +This quickstart demonstrates its functionalities on <<_running_in_a_bare_metal_environment, bare metal>> and using {productName} Maven plugin. + // System Requirements include::../shared-doc/system-requirements.adoc[leveloffset=+1] // Use of {jbossHomeName} include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] -== Build the Project +== Running in a bare metal environment + +=== Build the Project Follow these steps to build the project without deploying it. @@ -64,15 +76,15 @@ Follow these steps to build the project without deploying it. + [source,options="nowrap"] ---- -$ mvn clean install +$ mvn clean package ---- -== Configure the Server and Deploy the Quickstart +=== Configure the Server and Deploy the Quickstart You can choose to configure and deploy this quickstart to a xref:configure_the_server_and_deploy_the_quickstart_to_a_managed_domain[managed domain] or to a xref:configure_the_server_and_deploy_the_quickstart_to_a_standalone_server[standalone server]. The sections below describe how to configure and start the server for each configuration. [[configure_the_server_and_deploy_the_quickstart_to_a_managed_domain]] -=== Configure the Server and Deploy the Quickstart to a Managed Domain +==== Configure the Server and Deploy the Quickstart to a Managed Domain You configure the server by running the `install-domain.cli` script provided in the root directory of this quickstart. @@ -81,7 +93,7 @@ include::../shared-doc/back-up-managed-domain-configuration.adoc[leveloffset=+3] // Start the {productName} Managed Domain include::../shared-doc/start-the-managed-domain.adoc[leveloffset=+3] -==== Configure the Domain Server and Deploy the Quickstart Using the JBoss CLI +===== Configure the Domain Server and Deploy the Quickstart Using the JBoss CLI . Review the `install-domain.cli` file located in the root of this quickstart directory. This script creates the server group and servers and configures messaging clustering for testing this quickstart. You will note it does the following: @@ -124,25 +136,24 @@ The batch executed successfully ---- [[configure_the_server_and_deploy_the_quickstart_to_a_standalone_server]] -=== Configure the Server and Deploy the Quickstart to a Standalone Server +==== Configure the Server and Deploy the Quickstart to a Standalone Server If you choose to use standalone servers rather than a managed domain, you need two instances of the application server. The second server must be started with a port offset parameter provided to the startup script as `-Djboss.socket.binding.port-offset=100`. Since both application servers must be configured in the same way, you must configure the first server and then clone it. // Back Up the {productName} Standalone Server Configuration -include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+3] +include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+4] // Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+3] +include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+4] -==== Configure the Standalone Server and Deploy the Quickstart Using the JBoss CLI +===== Configure the Standalone Server and Deploy the Quickstart Using the JBoss CLI . Review the `install-standalone.cli` file located in the root of this quickstart directory. This script configures clustering for a standalone server. You will note it does the following: ** Because the console is disabled by default in the Full HA profile, it enables console logging to allow you to view the quickstart output. ** Enables clustering and sets a cluster password. ** Creates a delivery group named `my-mdb-delivery-group`, with initial active value set to `true`. -** Deploys the `{artifactId}.war` archive. ** Reloads the server configuration. . Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing `__{jbossHomeName}__` with the path to your server: + @@ -162,7 +173,18 @@ The batch executed successfully process-state: reload-required ---- -==== Clone the {productName} Directory +. Type the following command to deploy the quickstart. ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn wildfly:deploy +---- + +This deploys the `{archiveDir}/{archiveFileName}` to the running instance of the server. + +You should see a message in the server log indicating that the archive deployed successfully. + +===== Clone the {productName} Directory After you have successfully configured the server, you must make a copy of this {productName} directory structure to use for the second server. @@ -177,7 +199,7 @@ __{jbossHomeName}_2__/standalone/data/activemq/journal __{jbossHomeName}_2__/standalone/data/activemq/largemessages ---- -==== Start the {productName} Standalone Servers with the Full HA Profile +===== Start the {productName} Standalone Servers with the Full HA Profile Use the following commands to start the standalone servers with the full HA profile. @@ -189,9 +211,9 @@ $ __{jbossHomeName}_2__/bin/standalone.sh -c standalone-full-ha.xml -Djboss.sock NOTE: For Windows, use the `__{jbossHomeName}_1__\bin\standalone.bat` and `__{jbossHomeName}_2__\bin\standalone.bat` scripts. -== Access the Application +=== Access the Application -=== Access the Application Running in a Managed Domain +==== Access the Application Running in a Managed Domain The application will be running at the following URL: http://localhost:9080/{artifactId}/HelloWorldMDBServletClient. @@ -199,7 +221,7 @@ It will send some messages to the queue. To send messages to the topic, use the following URL: http://localhost:9080/{artifactId}/HelloWorldMDBServletClient?topic -=== Access the Application Running in a Standalone Server +==== Access the Application Running in a Standalone Server The application will be running at the following URL: http://localhost:8080/{artifactId}/HelloWorldMDBServletClient. @@ -207,7 +229,7 @@ It will send some messages to the queue. To send messages to the topic, use the following URL: http://localhost:8080/{artifactId}/HelloWorldMDBServletClient?topic -== Investigate the Server Console Output +=== Investigate the Server Console Output Review the messages in both {productName} server consoles or logs. @@ -235,7 +257,7 @@ INFO [class org.jboss.as.quickstarts.mdb.HelloWorldTopicMDB] (Thread-9 (ActiveM You will notice that only one of the nodes, elected as the singleton provider node, will be receiving the messages. For that, check both servers, only one will contain the received message log entries. -== Server Log: Expected Warnings and Errors +=== Server Log: Expected Warnings and Errors You will see the following warnings in the server logs. You can ignore these warnings as they are intended for production servers. @@ -247,7 +269,7 @@ WARNING [org.jgroups.protocols.UDP] (Thread-0 (ActiveMQ-server-ActiveMQServerImp WARNING [org.jgroups.protocols.UDP] (Thread-0 (ActiveMQ-server-ActiveMQServerImpl::serverUUID=c79278db-56e6-11e5-af50-69dd76236ee8-1573164340)) JGRP000015: the receive buffer of socket MulticastSocket was set to 25MB, but the OS only allocated 212.99KB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux) ---- -== Electing a New Singleton Provider Server +=== Electing a New Singleton Provider Server If you reboot the singleton server node, the other node will be elected the new singleton provider, and will start receiving the MDB messages instead. @@ -294,22 +316,22 @@ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:61 at java.lang.Thread.run(Thread.java:745) ---- -=== Rebooting the Singleton Provider Server Node in a Managed Domain +==== Rebooting the Singleton Provider Server Node in a Managed Domain Run the following command, replacing `__{jbossHomeName}__` with the path to your server, and replacing `NODE_X` in the script name with either `node1` or `node2`, depending on whether the current singleton provider is `node1` or `node2`. [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=restart-NODE_X-domain.cli +$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=restart-NODE_X-domain.cli ---- NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. -=== Rebooting the Singleton Provider Server Node in a Standalone Server +==== Rebooting the Singleton Provider Server Node in a Standalone Server Stop the provider server and restart it again, using the same command you used to start the server initially. -== Disable and Enable the Delivery Group +=== Disable and Enable the Delivery Group To disable the delivery group "my-mdb-delivery-group" to which the topic belongs, run the `disable-delivery-group-domain.cli` or `disable-delivery-group-standalone.cli` script, located in the root directory of this quickstart. Follow the instructions in the next sections, depending on the server configuration you choose to run. @@ -317,13 +339,13 @@ After disabling the delivery group, try sending messages to the topic, You shoul Next, enable the delivery group using the appropriate `enable-delivery-group-domain.cli` or `enable-delivery-group-standalone.cli` script, also located in the root directory of this quickstart, so that the topic messages can be delivered again. -=== Disable and Enable Delivery Group in a Managed Domain +==== Disable and Enable Delivery Group in a Managed Domain To disable the delivery group named "my-mdb-delivery-group" to which the topic belongs, run the `disable-delivery-group-domain.cli` script, replacing `__{jbossHomeName}__` with the path to your server: [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=disable-delivery-group-domain.cli +$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=disable-delivery-group-domain.cli ---- NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. @@ -332,18 +354,18 @@ Similarly, to enable the delivery group, run the `enable-delivery-group-domain.c [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-delivery-group-domain.cli +$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=enable-delivery-group-domain.cli ---- NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. -=== Disable and Enable Delivery Group in a Standalone Server +==== Disable and Enable Delivery Group in a Standalone Server To disable the delivery group named "my-mdb-delivery-group" to which the topic belongs, run the `disable-delivery-group-standalone.cli` script on both servers, replacing `__{jbossHomeName}__` with the path to your server: [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}_1__/bin/jboss-cli.sh --connect --file==disable-delivery-group-standalone.cli +$ __{jbossHomeName}_1__/bin/jboss-cli.sh --connect --file==disable-delivery-group-standalone.cli $ __{jbossHomeName}_2__/bin/jboss-cli.sh --connect controller=localhost:10090 --file=disable-delivery-group-standalone.cli ---- @@ -354,48 +376,58 @@ Similarly, to enable the delivery group, run the `enable-delivery-group-standalo [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}_1__/bin/jboss-cli.sh --connect --file==enable-delivery-group-standalone.cli +$ __{jbossHomeName}_1__/bin/jboss-cli.sh --connect --file==enable-delivery-group-standalone.cli $ __{jbossHomeName}_2__/bin/jboss-cli.sh --connect controller=localhost:10090 --file=enable-delivery-group-standalone.cli ---- NOTE: For Windows, use the `__{jbossHomeName}_1__\bin\jboss-cli.bat` and `__{jbossHomeName}_2__\bin\jboss-cli.bat` scripts. -== Undeploy the Archive + +// Server Distribution Testing +include::../shared-doc/run-integration-tests-with-server-distribution.adoc[leveloffset=+2] + +==== Run the Integration Tests in a Managed Domain + +The integration tests may also be run with the domain server by typing the following command. + +[source,subs="+quotes,attributes+",options="nowrap"] +---- +$ mvn verify -Pintegration-testing -Dserver.host="http://localhost:9080/messaging-clustering-singleton" +---- + +=== Undeploy the Archive When you are finished testing, use the following instructions to undeploy the quickstart. -=== Undeploy the quickstart in a Managed Domain +==== Undeploy the quickstart in a Managed Domain . xref:start_eap_managed_domain[Start the {productName} managed domain] as described above. . Open a new terminal, navigate to the root directory of this quickstart, and run the `undeploy-domain.cli` script, replacing `__{jbossHomeName}__` with the path to your server: + [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file==undeploy-domain.cli +$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file==undeploy-domain.cli ---- NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. -=== Undeploy the quickstart in a Standalone Server +==== Undeploy the quickstart in a Standalone Server +include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+4] -. xref:start_the_eap_standalone_server[Start the {productName} server with the standalone full HA profile] as described above. -. Open a terminal, navigate to the root directory of this quickstart, and run the `undeploy-standalone.cli` script, replacing `__{jbossHomeName}_1__` and `__{jbossHomeName}_2__` with the path to the appropriate server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] +Repeat the last step for the second server: + +[source,sh,options="nowrap"] ---- -$ __{jbossHomeName}_1__/bin/jboss-cli.sh --connect --file==undeploy-standalone.cli -$ __{jbossHomeName}_2__/bin/jboss-cli.sh --connect controller=localhost:10090 --file==undeploy-standalone.cli +$ mvn wildfly:undeploy -Dwildfly.port=10090 ---- -NOTE: For Windows, use the `__{jbossHomeName}_1__\bin\jboss-cli.bat` and `__{jbossHomeName}_2__\bin\jboss-cli.bat` scripts. - -== Restore the Server Configuration +=== Restore the Server Configuration -=== Restore the Domain Server Configuration +==== Restore the Domain Server Configuration -You can Restore the domain configuration by manually restoring the backup configuration files or by running the management CLI script. +You can restore the domain configuration by manually restoring the backup configuration files or by running the management CLI script. -==== Restore the Domain Server Configuration Manually +===== Restore the Domain Server Configuration Manually IMPORTANT: This method ensures the server is restored to its prior configuration. @@ -403,7 +435,7 @@ IMPORTANT: This method ensures the server is restored to its prior configuration . Restore the `__{jbossHomeName}__/domain/configuration/domain.xml` and `__{jbossHomeName}__/domain/configuration/host.xml` files with the back-up copies of the files. Make sure you replace `__{jbossHomeName}__` with the path to your server. -==== Restore the Domain Server Configuration by Running the Management CLI Script +===== Restore the Domain Server Configuration by Running the Management CLI Script IMPORTANT: This script returns the server to a default configuration and the result might not match the server configuration prior to testing this quickstart. If you were not running with the default configuration before testing this quickstart, you should follow the intructions above to manually restore the configuration to its previous state. @@ -413,7 +445,7 @@ IMPORTANT: This script returns the server to a default configuration and the res + [source,subs="+quotes,attributes+",options="nowrap"] ---- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=remove-domain.cli +$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=remove-domain.cli ---- + NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. @@ -426,19 +458,19 @@ This script removes the server configuration that was done by the `install-domai The batch executed successfully ---- -=== Restore the Standalone Server Configuration +==== Restore the Standalone Server Configuration -You can Restore the domain configuration by manually restoring the back-up copies the configuration files or by running the management CLI script. +You can Restore the standalone configuration by manually restoring the back-up copies the configuration files or by running the management CLI script. [[restore_the_standalone_server_configuration_manually]] -==== Restore the Standalone Server Configuration Manually +===== Restore the Standalone Server Configuration Manually IMPORTANT: This method ensures the server is restored to its prior configuration. . If they are running, stop both {productName} servers. . Restore the `__{jbossHomeName}_1__/standalone/configuration/standalone-full-ha.xml` file with the back-up copies of the file. Make sure you replace `__{jbossHomeName}_1__` with the path to your server. -==== Restore the Standalone Configuration by Running the Management CLI Script +===== Restore the Standalone Configuration by Running the Management CLI Script IMPORTANT: This script returns the server to the default configuration, which might not match the server configuration that existed prior to testing this quickstart. If you were not running with the default configuration before testing this quickstart, you should follow the intructions above to xref:restore_the_standalone_server_configuration_manually[manually restore the standalone configuration] to its previous state. @@ -468,20 +500,78 @@ This script removes the server configuration that was done by the install-standa The batch executed successfully ---- -=== Delete the Cloned Standalone {productName} Directory +==== Delete the Cloned Standalone {productName} Directory . If it is running, stop the second instance of the {productName} server. . Delete the cloned directory. -// Run the Quickstart in Red Hat CodeReady Studio or Eclipse -include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1] +// Build and run sections for other environments/builds +ifndef::ProductRelease,EAPXPRelease[] -//************************************************* -// Product Release content only -//************************************************* -ifdef::ProductRelease[] +[[build_and_run_the_quickstart_with_provisioned_server]] +== Building and running the quickstart application with provisioned {productName} server + +Instead of using a standard {productName} server distribution, the two {productName} servers to deploy and run the quickstart can be alternatively provisioned by activating the Maven profile named `provisioned-server` when building the quickstart: +[source,sh,subs="+quotes,attributes+",options="nowrap"] +---- +$ mvn clean package -Pprovisioned-server +$ mvn package -Pprovisioned-server \ + -Dwildfly.provisioning.dir=server2 -Djboss-as.home=target/server2 +---- + +The provisioned {productName} servers, with the quickstart deployed, can then be found in the `target/server` directory, and their usage is similar to a standard server distribution, with the simplification that there is never the need to specify the server configuration to be started. + +The server provisioning functionality is provided by the WildFly Maven Plugin, and you may find its configuration in the pom.xml files of the quickstart. + +=== Run the Integration Tests with a provisioned server + +The integration tests included with this quickstart, which verify that the quickstart runs correctly, may also be run with provisioned server. + +Follow these steps to run the integration tests. + +. Make sure the servers are provisioned by running the commands reported in <> + +. Start the {productName} provisioned servers in three distinct terminals, this time using the {productName} Maven Plugin, which is recommended for testing due to simpler automation. ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn wildfly:start -Djboss-as.home=target/server \ + -Dwildfly.serverConfig=standalone-full-ha.xml +---- ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn wildfly:start -Djboss-as.home=target/server2 \ + -Dwildfly.serverConfig=standalone-full-ha.xml \ + -Dwildfly.port=10090 \ + -Dwildfly.javaOpts="-Djboss.socket.binding.port-offset=100" +---- + +. Type the following command to run the `verify` goal with the `integration-testing` profile activated, and specifying the quickstart's URL using the `server.host` system property. ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn verify -Pintegration-testing -Dserver.host="http://localhost:8080" +---- ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn verify -Pintegration-testing -Dserver.host="http://localhost:8180" +---- + +. To shut down the {productName} provisioned servers using the {productName} Maven Plugin: ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn wildfly:shutdown +---- ++ +[source,subs="attributes+",options="nowrap"] +---- +$ mvn wildfly:shutdown -Dwildfly.port=10090 +---- + +endif::[] // Quickstart not compatible with OpenShift include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1] - -endif::[] \ No newline at end of file diff --git a/messaging-clustering-singleton/charts/helm.yaml b/messaging-clustering-singleton/charts/helm.yaml new file mode 100644 index 0000000000..b491379ce3 --- /dev/null +++ b/messaging-clustering-singleton/charts/helm.yaml @@ -0,0 +1,6 @@ +build: + uri: https://github.com/wildfly/quickstart.git + ref: main + contextDir: messaging-clustering-singleton +deploy: + replicas: 1 \ No newline at end of file diff --git a/messaging-clustering-singleton/install-domain.cli b/messaging-clustering-singleton/install-domain.cli index eb692e234c..5c3990cbfa 100644 --- a/messaging-clustering-singleton/install-domain.cli +++ b/messaging-clustering-singleton/install-domain.cli @@ -9,8 +9,8 @@ batch /server-group=quickstart-messaging-clustering-singleton-group:add(profile=full-ha, socket-binding-group=full-ha-sockets) # -- Add two servers to the new quickstart-messaging-clustering-singleton-group -/host=master/server-config=quickstart-messagingcluster-node1:add(group=quickstart-messaging-clustering-singleton-group, auto-start=true, socket-binding-port-offset=1000) -/host=master/server-config=quickstart-messagingcluster-node2:add(group=quickstart-messaging-clustering-singleton-group, auto-start=true, socket-binding-port-offset=1100) +/host=primary/server-config=quickstart-messagingcluster-node1:add(group=quickstart-messaging-clustering-singleton-group, auto-start=true, socket-binding-port-offset=1000) +/host=primary/server-config=quickstart-messagingcluster-node2:add(group=quickstart-messaging-clustering-singleton-group, auto-start=true, socket-binding-port-offset=1100) # -- Enable the console to allow us to view the quickstart output. /profile=full-ha/subsystem=logging/console-handler=CONSOLE:add(level=INFO,formatter="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n") @@ -33,5 +33,5 @@ deploy --server-groups=quickstart-messaging-clustering-singleton-group target/me run-batch # -- Start the newly defined servers -/host=master/server-config=quickstart-messagingcluster-node1:start(blocking=true) -/host=master/server-config=quickstart-messagingcluster-node2:start(blocking=true) +/host=primary/server=quickstart-messagingcluster-node1:start(blocking=true) +/host=primary/server=quickstart-messagingcluster-node2:start(blocking=true) diff --git a/messaging-clustering-singleton/install-standalone.cli b/messaging-clustering-singleton/install-standalone.cli index 824c1804e3..d1911cd183 100644 --- a/messaging-clustering-singleton/install-standalone.cli +++ b/messaging-clustering-singleton/install-standalone.cli @@ -8,11 +8,6 @@ batch # -- Add mdb-delivery-group named "my-mdb-delivery-group" /subsystem=ejb3/mdb-delivery-group=my-mdb-delivery-group:add(active=true) -# -- Deploy the messaging-clustering-singleton.war file -# NOTE: The following command assumes the quickstart is built -# If that is not the case, run mvn clean install before this script -deploy target/messaging-clustering-singleton.war - # -- Run this batch file run-batch diff --git a/messaging-clustering-singleton/pom.xml b/messaging-clustering-singleton/pom.xml index a6c3b80da8..0fff6ce4c9 100644 --- a/messaging-clustering-singleton/pom.xml +++ b/messaging-clustering-singleton/pom.xml @@ -43,8 +43,12 @@ - - 32.0.0.Final + + 32.0.0.Final + + ${version.server} + 5.0.0.Final + 5.10.0 @@ -108,10 +112,15 @@ org.wildfly.bom wildfly-ee-with-tools - ${version.server.bom} + ${version.bom.ee} pom import + + org.junit.jupiter + junit-jupiter-engine + ${version.junit-jupiter-engine} + @@ -143,7 +152,93 @@ jakarta.annotation-api provided + + org.junit.jupiter + junit-jupiter-engine + test + + + + + + org.wildfly.plugins + wildfly-maven-plugin + ${version.plugin.wildfly} + + + + + + + + provisioned-server + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + org.wildfly:wildfly-galleon-pack:${version.server} + + + + cloud-server + ejb + singleton-ha + embedded-activemq + + + + + + + + + false + + + ROOT.war + standalone-full-ha.xml + + + + + package + + + + + + + + + integration-testing + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + **/BasicRuntimeIT + + + + + + integration-test + verify + + + + + + + + diff --git a/messaging-clustering-singleton/remove-domain.cli b/messaging-clustering-singleton/remove-domain.cli index 252c54d052..57d69023b2 100644 --- a/messaging-clustering-singleton/remove-domain.cli +++ b/messaging-clustering-singleton/remove-domain.cli @@ -1,14 +1,14 @@ ## Batch file to remove the domain configuration for the messaging-clustering-singleton quickstart. # - Stop the servers -/host=master/server-config=quickstart-messagingcluster-node1:stop(blocking=true) -/host=master/server-config=quickstart-messagingcluster-node2:stop(blocking=true) +/host=primary/server=quickstart-messagingcluster-node1:stop(blocking=true) +/host=primary/server=quickstart-messagingcluster-node2:stop(blocking=true) batch # -- Remove the two servers from the quickstart-messaging-clustering-singleton-group -/host=master/server-config=quickstart-messagingcluster-node1:remove -/host=master/server-config=quickstart-messagingcluster-node2:remove +/host=primary/server-config=quickstart-messagingcluster-node1:remove +/host=primary/server-config=quickstart-messagingcluster-node2:remove # -- Remove the quickstart-messaging-clustering-singleton-group /server-group=quickstart-messaging-clustering-singleton-group:remove diff --git a/messaging-clustering-singleton/restart-node1-domain.cli b/messaging-clustering-singleton/restart-node1-domain.cli index 9a23d8d7a6..cdc8c9b205 100644 --- a/messaging-clustering-singleton/restart-node1-domain.cli +++ b/messaging-clustering-singleton/restart-node1-domain.cli @@ -1,2 +1,2 @@ # -- Restart the node1 server -/host=master/server-config=quickstart-messagingcluster-node1:restart(blocking=true) +/host=primary/server=quickstart-messagingcluster-node1:restart(blocking=true) diff --git a/messaging-clustering-singleton/restart-node2-domain.cli b/messaging-clustering-singleton/restart-node2-domain.cli index 275d24e901..ef357f1d37 100644 --- a/messaging-clustering-singleton/restart-node2-domain.cli +++ b/messaging-clustering-singleton/restart-node2-domain.cli @@ -1,2 +1,2 @@ # -- Restart the node2 server -/host=master/server-config=quickstart-messagingcluster-node2:restart(blocking=true) +/host=primary/server=quickstart-messagingcluster-node2:restart(blocking=true) diff --git a/messaging-clustering-singleton/src/test/java/org/jboss/as/quickstarts/mdb/BasicRuntimeIT.java b/messaging-clustering-singleton/src/test/java/org/jboss/as/quickstarts/mdb/BasicRuntimeIT.java new file mode 100644 index 0000000000..857636105a --- /dev/null +++ b/messaging-clustering-singleton/src/test/java/org/jboss/as/quickstarts/mdb/BasicRuntimeIT.java @@ -0,0 +1,89 @@ +/* + * Copyright 2024 JBoss by Red Hat. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.mdb; + +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +/** + * The very basic runtime integration testing. + * + * @author istudens + */ +public class BasicRuntimeIT { + + private static final String DEFAULT_SERVER_HOST = "http://localhost:8080/messaging-clustering-singleton"; + + @Test + public void testHTTPQueueEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException { + String serverHost = System.getenv("SERVER_HOST"); + if (serverHost == null) { + serverHost = System.getProperty("server.host"); + } + if (serverHost == null) { + serverHost = DEFAULT_SERVER_HOST; + } + final HttpRequest request = HttpRequest.newBuilder() + .uri(new URI(serverHost + "/HelloWorldMDBServletClient")) + .GET() + .build(); + final HttpClient client = HttpClient.newBuilder() + .followRedirects(HttpClient.Redirect.ALWAYS) + .connectTimeout(Duration.ofMinutes(1)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + assertEquals(200, response.statusCode()); + for (int i = 0; i < 5; i++) { + String messageLine = "Message (" + i + "): This is message " + (i + 1); + assertTrue(response.body().contains(messageLine), response.body() + " doesn't contain " + messageLine); + } + } + @Test + public void testHTTPTopicEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException { + String serverHost = System.getenv("SERVER_HOST"); + if (serverHost == null) { + serverHost = System.getProperty("server.host"); + } + if (serverHost == null) { + serverHost = DEFAULT_SERVER_HOST; + } + final HttpRequest request = HttpRequest.newBuilder() + .uri(new URI(serverHost + "/HelloWorldMDBServletClient?topic=true")) + .GET() + .build(); + final HttpClient client = HttpClient.newBuilder() + .followRedirects(HttpClient.Redirect.ALWAYS) + .connectTimeout(Duration.ofMinutes(1)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + assertEquals(200, response.statusCode()); + for (int i = 0; i < 5; i++) { + String messageLine = "Message (" + i + "): This is message " + (i + 1); + assertTrue(response.body().contains(messageLine), response.body() + " doesn't contain " + messageLine); + } + } +} diff --git a/messaging-clustering-singleton/undeploy-standalone.cli b/messaging-clustering-singleton/undeploy-standalone.cli deleted file mode 100644 index 1c6826c816..0000000000 --- a/messaging-clustering-singleton/undeploy-standalone.cli +++ /dev/null @@ -1,3 +0,0 @@ -# Management CLI script to undeploy messaging-clustering-singleton.war - -undeploy messaging-clustering-singleton.war