Skip to content

Commit

Permalink
Merge pull request #765 from ehsavoie/WFLY-18473
Browse files Browse the repository at this point in the history
WFLY-18473: helloworld-jms Quickstart Common Enhancements CY2023Q3.
  • Loading branch information
emmartins authored Nov 15, 2023
2 parents 2e6c220 + e19254c commit 437e55f
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 120 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/quickstart_helloworld-jms_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: WildFly helloworld-jms Quickstart CI

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'helloworld-jms/**'
- '.github/workflows/quickstart_ci.yml'
jobs:
call-quickstart_ci:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: helloworld-jms
TEST_PROVISIONED_SERVER: true
TEST_OPENSHIFT: false
57 changes: 7 additions & 50 deletions helloworld-jms/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You configure the JMS `test` queue by running JBoss CLI commands. For your conve
* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above.
* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone full profile] as described above.

. Review the `configure-jms.cli` file in the root of this quickstart directory. This script adds the `test` queue to the `messaging` subsystem in the server configuration file.
. Review the `configure-jms.cli` file in the `src/main/scripts/` folder of this quickstart directory. This script adds the `test` queue to the `messaging` subsystem in the server configuration file.
. 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:
+
[source,subs="+quotes,attributes+",options="nowrap"]
Expand Down Expand Up @@ -75,26 +75,11 @@ The following `testQueue` jms-queue was configured in the default server configu
----


== Build and Execute the Quickstart
// Server Distribution Testing
include::../shared-doc/run-integration-tests-with-server-distribution.adoc[leveloffset=+1]

. xref:start_the_eap_standalone_server[Start the {productName} server with the standalone full profile] as described above.

. Open a terminal and navigate to the root of the helloworld-jms quickstart directory:
+
[source,options="nowrap"]
----
$ cd PATH_TO_QUICKSTARTS/helloworld-jms
----

. Type the following command to compile and execute the quickstart:
+
[source,options="nowrap"]
----
$ mvn clean compile exec:java
----


== Investigate the Console Output
=== Investigate the Console Output

If the Maven command is successful, with the default configuration you will see output similar to this:

Expand All @@ -117,9 +102,9 @@ timestamp org.jboss.as.quickstarts.jms.HelloWorldJMSClient main
INFO: Received message with content Hello, World!
----

== Optional Properties
=== Optional Properties

The example provides for a certain amount of customization for the `mvn:exec` plug-in using the system properties.
The example provides for a certain amount of customization for the integration test using the system properties.

[cols="20%,30%,50%",options="headers"]
|===
Expand Down Expand Up @@ -167,32 +152,4 @@ This script removes the `test` queue from the `messaging` subsystem in the serve
The batch executed successfully
----

// Restore the {productName} Standalone Server Configuration Manually
include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+2]
// Run the Quickstart in Red Hat CodeReady Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]

// Additional Red Hat CodeReady Studio instructions
This quickstart consists of multiple projects, so it deploys and runs differently in {JBDSProductName} than the other quickstarts.

. Make sure you xref:add_the_application_user[add the authorized application user] as described above.
. Configure and start the {productName} server in {JBDSProductName}:
** Define a server runtime environment that uses the `standalone-full.xml` configuration file.
** Start the server defined in the previous step.
. Outside of {JBDSProductName}, configure the JMS `test` queue by running the JBoss CLI commands as described above under xref:configure_the_server[Configure the Server].
. In {JBDSProductName}, right-click on the *{artifactId}* project and choose *Run As* -> *Java Application*. In the *Select Java Application* window, choose *HellowWorldJMSClient - org.jboss.as.quickstarts.jms* and click *OK*. The client output displays in the *Console* window.
The output messages appear in the *Console* window.
. Make sure you xref:restore_the_server_configuration[restore the {productName} server configuration] when you have completed testing this quickstart.

// Debug the Application
include::../shared-doc/debug-the-application.adoc[leveloffset=+1]

//*************************************************
// Product Release content only
//*************************************************
ifdef::ProductRelease[]
// Quickstart not compatible with OpenShift
include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1]
199 changes: 149 additions & 50 deletions helloworld-jms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@
</licenses>

<properties>
<!-- The versions for BOMs, Dependencies and Plugins -->
<version.server.bom>30.0.0.Final</version.server.bom>
<!-- the version for the Server -->
<version.server>30.0.0.Final</version.server>
<!-- The versions for BOMs, Packs and Plugins -->
<version.bom.ee>${version.server}</version.bom.ee>
<version.pack.cloud>5.0.0.Final</version.pack.cloud>
<version.plugin.wildfly>4.2.0.Final</version.plugin.wildfly>
<version.junit-jupiter-engine>5.10.0</version.junit-jupiter-engine>
</properties>

<repositories>
Expand Down Expand Up @@ -108,10 +113,15 @@
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-ee-with-tools</artifactId>
<version>${version.server.bom}</version>
<version>${version.bom.ee}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${version.junit-jupiter-engine}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -128,55 +138,144 @@
<artifactId>wildfly-jms-client-bom</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<!-- Set the name of the archive -->
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>org.jboss.as.quickstarts.jms.HelloWorldJMSClient</mainClass>
<systemProperties>
<!-- Override the default values of properties passed to the HelloWorldJMSClient -->
<!--
<systemProperty>
<key>java.naming.provider.url</key>
<value>remote://localhost:8080</value>
</systemProperty>
<systemProperty>
<key>username</key>
<value>quickstartUser</value>
</systemProperty>
<systemProperty>
<key>password</key>
<value>quickstartPwd1!</value>
</systemProperty>
<systemProperty>
<key>connection.factory</key>
<value>jms/RemoteConnectionFactory</value>
</systemProperty>
<systemProperty>
<key>destination</key>
<value>jms/queue/test</value>
</systemProperty>
<systemProperty>
<key>message.count</key>
<value>1</value>
</systemProperty>
<systemProperty>
<key>message.content</key>
<value>Hello, World!</value>
</systemProperty-->
<systemProperty>
<key>java.logging.config.file</key>
<value>./helloworld-jms-logging.properties</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.plugin.wildfly}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>provisioned-server</id>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
<layer>ejb</layer>
<layer>embedded-activemq</layer>
</layers>
<name>ROOT.war</name>
<packaging-scripts>
<packaging-script>
<scripts>
<script>${project.build.scriptSourceDirectory}/configure-jms.cli</script>
</scripts>
<!-- Expressions resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</packaging-script>
</packaging-scripts>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>openshift</id>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack:${version.server}</location>
</feature-pack>
<feature-pack>
<location>org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.pack.cloud}</location>
</feature-pack>
</feature-packs>
<layers>
<layer>cloud-server</layer>
<layer>ejb</layer>
<layer>embedded-activemq</layer>
</layers>
<filename>ROOT.war</filename>
<packaging-scripts>
<packaging-script>
<scripts>
<script>${project.build.scriptSourceDirectory}/configure-jms.cli</script>
</scripts>
<!-- Expressions resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</packaging-script>
</packaging-scripts>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-testing</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<includes>
<include>**/HelloWorldJMSClientIT</include>
</includes>
<systemPropertyVariables>
<java.logging.config.file>helloworld-jms-logging.properties</java.logging.config.file>
<!-- Override the default values of properties passed to the HelloWorldJMSClientIT -->
<java.naming.provider.url>http-remoting://127.0.0.1:8080</java.naming.provider.url>
<username>quickstartUser</username>
<password>quickstartPwd1!</password>
<connection.factory>jms/RemoteConnectionFactory</connection.factory>
<destination>jms/queue/test</destination>
<message.count>5</message.count>
<message.content>Hello, World! Test 5</message.content>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# JBoss, Home of Professional Open Source
# Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
# contributors by the @authors tag. See the copyright.txt in the
# distribution for a full listing of individual contributors.
#
# 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.
#

# Specify the handlers to create in the root logger
# (all loggers are children of the root logger)
# The following creates two handlers
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler

# Set the default logging level for the root logger
.level = ALL

# Set the default logging level for new ConsoleHandler instances
java.util.logging.ConsoleHandler.level = ALL

# Set the default logging level for new FileHandler instances
java.util.logging.FileHandler.level = ALL
java.util.logging.FileHandler.pattern = helloworld-jms.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1

# Set the default formatter for new ConsoleHandler instances
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

# Set the default logging level for the logger named com.mycompany
org.jboss.as.quickstarts.jms = ALL
File renamed without changes.
Loading

0 comments on commit 437e55f

Please sign in to comment.