Skip to content

Commit

Permalink
JBTM-3150 Migrate from swarm to thorntail
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusgrov committed Jun 4, 2019
1 parent 92e7060 commit 5b6f9a0
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 117 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ main() {

echo "$MVN $MVN_OPTIONS $MVN_GOAL $ADDIT_PARAMS"

# workaround in case 'mvn -f' is not supported, for example WFLY Swarm plugin (THORN-2049)
# workaround in case 'mvn -f' is not supported, for example WFLY Thorntail plugin (THORN-2049)
if [ "$PRESERVE_WORKING_DIR" = "true" ]; then cd "$ORIG_WORKING_DIR"; fi

# Execute in debug mode, or simply execute.
Expand Down
2 changes: 1 addition & 1 deletion narayana-full/src/main/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<destName>xts_third_party_licenses.txt</destName>
</file>
<file>
<source>../rts/lra/lra-coordinator/target/lra-coordinator-swarm.jar</source>
<source>../rts/lra/lra-coordinator/target/lra-coordinator-thorntail.jar</source>
<fileMode>0755</fileMode>
<outputDirectory>rts/lra/</outputDirectory>
</file>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
<version.javax.javaee-api>7.0</version.javax.javaee-api>
<version.javax.ws.rs-api>2.0.1</version.javax.ws.rs-api>
<version.org.mockito>2.5.3</version.org.mockito>
<version.org.wildfly.checkstyle-config>1.0.6.Final</version.org.wildfly.checkstyle-config>
<version.org.wildfly.checkstyle-config>1.0.8.Final</version.org.wildfly.checkstyle-config>
<version.com.github.docker-java>3.0.14</version.com.github.docker-java>

<!-- Maven plugin versions -->
Expand Down
38 changes: 11 additions & 27 deletions rts/lra/lra-coordinator/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.narayana.rts</groupId>
Expand All @@ -19,7 +16,7 @@

<failOnMissingWebXml>false</failOnMissingWebXml>
<narayana.nodename.property>CoreEnvironmentBean.nodeIdentifier</narayana.nodename.property>
<swarm.http.port>8080</swarm.http.port>
<thorntail.http.port>8080</thorntail.http.port>
</properties>

<build>
Expand All @@ -31,9 +28,9 @@
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<version>${version.wildfly-swarm}</version>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.wildfly-thorntail}</version>
<executions>
<execution>
<goals>
Expand All @@ -43,10 +40,10 @@
</executions>
<configuration>
<environment>
<swarm.http.port>${swarm.http.port}</swarm.http.port>
<thorntail.http.port>${thorntail.http.port}</thorntail.http.port>
</environment>
<properties>
<lra.http.port>${swarm.http.port}</lra.http.port>
<lra.http.port>${thorntail.http.port}</lra.http.port>
</properties>
</configuration>
</plugin>
Expand All @@ -55,15 +52,15 @@

<dependencies>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<groupId>io.thorntail</groupId>
<artifactId>jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<groupId>io.thorntail</groupId>
<artifactId>cdi</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<groupId>io.thorntail</groupId>
<artifactId>swagger</artifactId>
</dependency>

Expand All @@ -78,25 +75,12 @@
<version>${project.version}</version>
</dependency>

<!-- For swarm plugin to run -->
<!-- For thorntail plugin to run -->
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${version.resteasy-client}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>arquillian</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ private URI unpackURI(InputObjectState os) throws IOException, URISyntaxExceptio
}

private static int getTypeId() {
return RecordType.USER_DEF_FIRST0; // RecordType.LRA_RECORD; TODO we depend on swarm for narayana which is using an earlier version
return RecordType.USER_DEF_FIRST0; // RecordType.LRA_RECORD; TODO we depend on thorntail for narayana which is using an earlier version
}

public int typeIs() {
Expand Down
15 changes: 0 additions & 15 deletions rts/lra/lra-coordinator/src/test/resources/arquillian-swarm.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void init() {
participants = new ArrayList<>();
}

int httpPort = Integer.getInteger("swarm.http.port", 8081);
String httpHost = System.getProperty("swarm.http.host", "localhost");
int httpPort = Integer.getInteger("thorntail.http.port", 8081);
String httpHost = System.getProperty("thorntail.http.host", "localhost");

// TODO if the proxy is restarted on a different endpoint it should notify the recovery coordinator

Expand Down
25 changes: 11 additions & 14 deletions rts/lra/lra-proxy/test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
~ Copyright 2017 Red Hat, Inc. and/or its affiliates.
~
~ Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.narayana.rts</groupId>
Expand All @@ -21,14 +18,14 @@

<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
<swarm.http.port>8081</swarm.http.port>
<thorntail.http.port>8081</thorntail.http.port>
<lra.http.host>localhost</lra.http.host>
<lra.http.port>8080</lra.http.port>
<service.http.port>${swarm.http.port}</service.http.port>
<service.http.port>${thorntail.http.port}</service.http.port>

<swarm.debug.params></swarm.debug.params>
<swarm.logging.params></swarm.logging.params>
<swarm.debug.port>8787</swarm.debug.port>
<thorntail.debug.params/>
<thorntail.logging.params/>
<thorntail.debug.port>8787</thorntail.debug.port>

<skipITs>true</skipITs>
</properties>
Expand All @@ -37,9 +34,9 @@
<finalName>lra-proxy-test</finalName>
<plugins>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<version>${version.wildfly-swarm}</version>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.wildfly-thorntail}</version>
<executions>
<execution>
<goals>
Expand All @@ -49,7 +46,7 @@
</executions>
<configuration>
<environment>
<swarm.http.port>${swarm.http.port}</swarm.http.port>
<thorntail.http.port>${thorntail.http.port}</thorntail.http.port>
</environment>
<properties>
<lra.http.host>${lra.http.host}</lra.http.host>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
public class SpecTest {
private static URL MICRSERVICE_BASE_URL;

private static final int COORDINATOR_SWARM_PORT = 8080;
private static final int TEST_SWARM_PORT = 8081;
private static final int COORDINATOR_THORNTAIL_PORT = 8080;
private static final int TEST_THORNTAIL_PORT = 8081;

private static NarayanaLRAClient lraClient;
private static Client msClient;
Expand All @@ -39,8 +39,8 @@ public class SpecTest {
@BeforeClass
public static void setupClass() throws Exception {
System.out.println("Getting ready to connect - waiting for coordinator to startup...");
int servicePort = Integer.getInteger("service.http.port", TEST_SWARM_PORT);
int rcPort = Integer.getInteger(LRA_COORDINATOR_PORT_KEY, COORDINATOR_SWARM_PORT);
int servicePort = Integer.getInteger("service.http.port", TEST_THORNTAIL_PORT);
int rcPort = Integer.getInteger(LRA_COORDINATOR_PORT_KEY, COORDINATOR_THORNTAIL_PORT);
String rcHost = System.getProperty(LRA_COORDINATOR_HOST_KEY, "localhost");

MICRSERVICE_BASE_URL = new URL("http://localhost:" + servicePort);
Expand Down
14 changes: 7 additions & 7 deletions rts/lra/lra-test/tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<lra.tck.suite.host>localhost</lra.tck.suite.host>
<lra.tck.suite.port>8180</lra.tck.suite.port>
<lra.tck.suite.swarm.trace.params></lra.tck.suite.swarm.trace.params>
<lra.tck.suite.thorntail.trace.params></lra.tck.suite.thorntail.trace.params>
<lra.tck.suite.debug.params></lra.tck.suite.debug.params> <!-- has content when -Ddebug.tck is specified -->
<lra.tck.suite.debug.port>8788</lra.tck.suite.debug.port>

Expand All @@ -45,7 +45,7 @@
<java.util.logging.config.file>${project.build.testOutputDirectory}/logging.properties</java.util.logging.config.file>
<lra.tck.suite.host>${lra.tck.suite.host}</lra.tck.suite.host>
<lra.tck.suite.port>${lra.tck.suite.port}</lra.tck.suite.port>
<lra.tck.suite.swarm.trace.params>${lra.tck.suite.swarm.trace.params}</lra.tck.suite.swarm.trace.params>
<lra.tck.suite.thorntail.trace.params>${lra.tck.suite.thorntail.trace.params}</lra.tck.suite.thorntail.trace.params>
<lra.coordinator.port>${lra.coordinator.port}</lra.coordinator.port>
<lra.tck.suite.debug.params>${lra.tck.suite.debug.params}</lra.tck.suite.debug.params>
</systemPropertyVariables>
Expand Down Expand Up @@ -118,7 +118,7 @@
</property>
</activation>
<properties>
<lra.coordinator.trace.params>-Dswarm.logging=TRACE</lra.coordinator.trace.params>
<lra.coordinator.trace.params>-Dthorntail.logging=TRACE</lra.coordinator.trace.params>
</properties>
</profile>
<profile>
Expand All @@ -129,7 +129,7 @@
</property>
</activation>
<properties>
<lra.tck.suite.swarm.trace.params>-Dswarm.logging=TRACE</lra.tck.suite.swarm.trace.params>
<lra.tck.suite.thorntail.trace.params>-Dthorntail.logging=TRACE</lra.tck.suite.thorntail.trace.params>
</properties>
</profile>
<profile>
Expand Down Expand Up @@ -159,16 +159,16 @@
<waitForInterrupt>false</waitForInterrupt>
<!--<processLogFile>${project.build.directory}/failsafe-reports/lra-coordinator-startup.log</processLogFile>-->
<environment>
<swarm.http.port>${lra.coordinator.port}</swarm.http.port>
<swarm.transactions.node-identifier>2</swarm.transactions.node-identifier>
<thorntail.http.port>${lra.coordinator.port}</thorntail.http.port>
<thorntail.transactions.node-identifier>2</thorntail.transactions.node-identifier>
</environment>
<arguments>
<argument>${java.home}/bin/java</argument>
<argument>-Djava.net.preferIPv4Stack=true</argument>
<argument>${lra.coordinator.debug.params}</argument>
<argument>${lra.coordinator.trace.params}</argument>
<argument>-jar</argument>
<argument>${project.basedir}/../../lra-coordinator/target/lra-coordinator-swarm.jar</argument>
<argument>${project.basedir}/../../lra-coordinator/target/lra-coordinator-thorntail.jar</argument>
</arguments>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@

/**
* The appender provides way to bundle LRA interfaces implementation classes to the deployment
* as the Swarm container does not bundle the LRA classes to the fat jar until
* as the Thorntail container does not bundle the LRA classes to the fat jar until
* there is no fraction for it.
*/
public class ConfigAuxiliaryArchiveAppender implements AuxiliaryArchiveAppender {

@Override
public Archive<?> createAuxiliaryArchive() {
JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
// adding LRA spec interfaces under the WildFly Swarm deployment
// adding LRA spec interfaces under the Thorntail deployment
.addPackages(true, org.eclipse.microprofile.lra.annotation.Compensate.class.getPackage())
.addPackages(true, org.eclipse.microprofile.lra.participant.LRAParticipant.class.getPackage());
// adding Narayana LRA implementation under the WildFly Swarm deployment
// adding Narayana LRA implementation under the Thorntail deployment
archive.addPackages(true, io.narayana.lra.client.NarayanaLRAClient.class.getPackage())
.addPackages(true, io.narayana.lra.Current.class.getPackage());

// adding Narayana LRA filters under the WildFly Swarm deployment
// adding Narayana LRA filters under the Thorntail deployment
String filtersAsset = String.format("%s%n%s",
io.narayana.lra.filter.ClientLRAResponseFilter.class.getName(),
io.narayana.lra.filter.ClientLRARequestFilter.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<container qualifier="managedContainer" default="true" mode="suite">
<configuration>
<property name="host">localhost</property>
<property name="port">${swarm.arquillian.daemon.port:12345}</property>
<property name="javaVmArguments">${lra.tck.suite.swarm.trace.params} ${lra.tck.suite.debug.params} -Dswarm.http.host=${lra.tck.suite.host} -Dswarm.http.port=${lra.tck.suite.port} -Dlra.tck.coordinator.hostname=localhost -Dlra.tck.coordinator.port=${lra.coordinator.port} -Dlra.http.host=localhost -Dlra.http.port=${lra.coordinator.port}</property>
<property name="port">${thorntail.arquillian.daemon.port:12345}</property>
<property name="javaVmArguments">${lra.tck.suite.thorntail.trace.params} ${lra.tck.suite.debug.params} -Dthorntail.http.host=${lra.tck.suite.host} -Dthorntail.http.port=${lra.tck.suite.port} -Dlra.tck.coordinator.hostname=localhost -Dlra.tck.coordinator.port=${lra.coordinator.port} -Dlra.http.host=localhost -Dlra.http.port=${lra.coordinator.port}</property>
</configuration>
</container>
</arquillian>
Loading

0 comments on commit 5b6f9a0

Please sign in to comment.