Skip to content

Commit

Permalink
Merge pull request #773 from mmusgrov/WFLY-18488
Browse files Browse the repository at this point in the history
WFLY-18488 jts Quickstart Common Enhancements CY2023Q3
  • Loading branch information
emmartins authored Nov 20, 2023
2 parents 630f60a + 578a18f commit 59d4d80
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/quickstart_jts_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: WildFly jts Quickstart CI

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- jts/**'
- .github/workflows/quickstart_ci.yml

jobs:
call-quickstart_ci:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: jts
TEST_PROVISIONED_SERVER: false
TEST_OPENSHIFT: false
63 changes: 61 additions & 2 deletions jts/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ After stopping the server, open the `__{jbossHomeName}__/standalone/configuratio
[source,xml,subs="attributes+",options="nowrap"]
----
<subsystem xmlns="{IiopOpenJdkSubsystemNamespace}">
<initializers transactions="full" security="identity"/>
<initializers security="elytron" transactions="full" />
</subsystem>
----

Expand All @@ -140,6 +140,8 @@ After stopping the server, open the `__{jbossHomeName}__/standalone/configuratio
</process-id>
</core-environment>
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
<coordinator-environment statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
<object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
<jts/>
</subsystem>
----
Expand All @@ -156,6 +158,63 @@ Application server 1 must be now configured to use the PostgreSQL database creat
. Follow the instructions to link:{configurePostgresAddModuleDocUrl}[Add the PostgreSQL Module to the {productName} Server] to the server 1 install only.
. Follow the instructions to link:{configurePostgresDriverDocUrl}[Configure the PostgreSQL Driver in the {ProductName} Server] for the server 1 configuration. Make sure you pass the `-Djboss.tx.node.id=UNIQUE_NODE_ID_1` on the command line when you start the first server to configure PostgreSQL.

If there are issues with the scripts or you just want to configure the servers manually then the following will work:

Start server 1:
```
export WILDFLY_HOME_1=...
$WILDFLY_HOME_1/bin/standalone.sh -c standalone-full.xml -Djboss.tx.node.id=UNIQUE_NODE_ID_1 &
# enable JTS mode
cd <quickstarts repo>/jts
$WILDFLY_HOME_1/bin/jboss-cli.sh --connect --file=configure-jts-transactions.cli
```

Stop server 1 and create second server by copying the installation directory:
```
cp -r $WILDFLY_HOME_1 ${WILDFLY_HOME_1}-2
export WILDFLY_HOME_2=${WILDFLY_HOME_1}-2
```

Configure postgresql on server 1 only as a module:
```
mkdir -p $WILDFLY_HOME_1/modules/org/postgresql/main
# download postgresql-42.6.0.jar or later and install it into the server:
cp <downloads>/postgresql-42.6.0.jar $WILDFLY_HOME_1/modules/org/postgresql/main
```
Create a module.xml for postgresql with the following contents:
```
$ cat $WILDFLY_HOME_1/modules/org/postgresql/main/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.postgresql">
<resources>
<!--resource-root path="postgresql-42.1.4.jre7.jar"/-->
<resource-root path="postgresql-42.6.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
```

Add the datasource to $WILDFLY_HOME_1/standalone/configuration/standalone-full.xml
When you have done this the final changes to standalone-full.xml should be:

```
$ diff $WILDFLY_HOME_1/standalone/configuration/standalone-full.xml $WILDFLY_HOME_2/standalone/configuration/standalone-full.xml
137,142d136
< <datasource jndi-name="java:jboss/datasources/PostgresDS" pool-name="PostgresDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
< <connection-url>jdbc:postgresql://localhost:5432/postgres</connection-url>
< <driver>postgresql</driver>
< <security user-name="sa" password="sa"/>
< </datasource>
<
147,149d140
< <driver name="postgresql" module="org.postgresql">
< <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
< </driver>

```
[[start_the_servers]]
== Start the Servers

Expand Down Expand Up @@ -342,4 +401,4 @@ ifdef::ProductRelease[]
// Quickstart not compatible with OpenShift
include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1]
endif::[]
endif::[]
20 changes: 17 additions & 3 deletions jts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@

<properties>
<!-- The versions for BOMs, Dependencies and Plugins -->
<version.server.bom>30.0.0.Final</version.server.bom>
<version.server>30.0.0.Beta1</version.server>
<version.bom.ee>${version.server}</version.bom.ee>
<version.plugin.wildfly>4.2.0.Final</version.plugin.wildfly>
</properties>

<repositories>
Expand Down Expand Up @@ -116,7 +118,7 @@
<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>
Expand All @@ -129,5 +131,17 @@
</dependency>
</dependencies>
</dependencyManagement>


<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.plugin.wildfly}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>

0 comments on commit 59d4d80

Please sign in to comment.