Thorntail Logo
 

An Introduction to Thorntail

Today Red Hat is making Thorntail 2.2 generally available to Red Hat customers through a subscription to Red Hat OpenShift Application Runtimes (RHOAR). RHOAR provides application developers with a variety of application runtimes running on the OpenShift Container Platform.

Thorntail is the new name for WildFly Swarm, and bundles everything you need to develop and run Thorntail and MicroProfile applications by packaging server runtime libraries with your application code and running it with java -jar. It speeds up the transition from monoliths to microservices and takes advantage of your existing industry standard Java EE technology experience.

What does Thorntail Include?

This release is an incremental release from WildFly Swarm 7.1, and adds support for MicroProfile 1.3, a feature-rich collection of APIs for developing enterprise microservices. Beyond the core Java EE technologies like JAX-RS, CDI, and JSON-P, MicroProfile 1.3 includes:

  • Config 1.2: Externalizes configuration, separating business logic from service configuration. Service configurations developed with Thorntail 2.2 can be can read from OpenShift ConfigMaps.
  • Fault Tolerance 1.0: Implements a collection of programming patterns like Bulkheads, Timeouts, Circuit Breakers, and Fallbacks to monitor and gracefully react to potential failure conditions. Utilizing these patterns can eliminate the potential for cascading failures in a microservices architecture.
  • Metrics 1.1: Exposes a collection of common runtime metrics and custom application-defined metrics using constructs like Gauges, Counters, and Meters. Services developed with Thorntail 2.2 can be exposed to Prometheus monitoring on OpenShift.
  • Health Check 1.0: Standard endpoint that exposes a custom-developed service’s health to the underlying platform. When running on OpenShift, health check probes can monitor this endpoint and restart the containers running an unhealthy service.
  • OpenTracing 1.0: Enables tracing the flow of a request as it traverses multiple services within a microservices architecture. When Thorntail is used with Jaeger (a distributed tracing service), organizations can quickly track down performance bottlenecks.
  • Open API 1.0: A Java implementation of the Open API specification that exposes machine-readable format of custom-developed RESTful endpoints.
  • Rest Client 1.0: A type-safe API for invoking RESTful services.
  • JWT RBAC 1.0: Using OpenID Connect (OIDC)-based JSON Web Tokens (JWT) for role-based access control of microservices endpoints.

Thorntail also includes a number of features that make it easy to deploy and manage Thorntail projects, such as integrating data sources, support for Keycloak and Red Hat SSO, and more. Consult the release notes for a complete list.

Other changes for Wildfly Swarm users in Thorntail

With the exception of the build configuration file (pom.xml) and log output (more below), Thorntail is API-compatible with WildFly Swarm. The build configuration file will need to be updated with name of Thorntail artifacts:

  • org.wildfly.swarm references will need to be changed to io.thorntail
  • If you're using the WildFly Swarm Maven Plugin, you'll need to update the Maven artifactId to thorntail-maven-plugin

This can be automated using a simple Maven command (run from your project's base directory):

mvn io.thorntail:thorntail-maven-plugin:2.2.0.Final-redhat-00021:migrate-from-wildfly-swarm

Be aware that the suffix used in the name of the generated uberjar also changes to -thorntail.jar. If you have CI/CD logic that depends on this suffix, you'll need to update to take this into account.

A few other notes:

  • Because Thorntail is considered the “next dot release” of WildFly Swarm, there are new features available, most notably support for MicroProfile 1.3 (see above)
  • With the rename to Thorntail, the version of Thorntail available with RHOAR will be identical to the upstream project version releases. This will make it easier for you to map versions of Thorntail to an upstream release.
  • Log message codes have changed from WFSnnnnn or WFSWARMnnnn to THORNnnnnn or TTnnnnn. Any monitoring of error codes will need to be updated.
  • And finally, Thorntail has a new logo you can see at the top of this post!

Launch into OpenShift

Thorntail featured in Launcher
Thorntail featured in Launcher
Thorntail featured in Launcher

Using developers.redhat.com/launch you can immediately create and deploy a Thorntail application directly to OpenShift Online or to your own local OpenShift cluster. It provides a hassle-free way of creating example applications, called boosters, as well as an easy way to build and deploy those boosters to OpenShift.

Boosters are available to showcase how developers can use Thorntail to build fundamental building blocks of cloud-native applications and services, such as creating secured RESTful APIs, implementing health checks, externalizing configuration, or integrating with the OpenShift Service Mesh based on the Istio project.

Test driving a sample app using Thorntail

Thorntail is a Java framework, and as such it can be run using OpenJDK. Let's test drive one of the Thorntail boosters on OpenShift (here I am using the Red Hat CDK, but any OpenShift cluster will do). The following is one set of commands you could use to pull the OpenJDK image to your local system for use with Thorntail:

oc new-project thorntail
oc import-image java:8 --from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift --confirm

Then, the following commands could be used to build and deploy the Thorntail application to Red Hat OpenShift:

oc new-app --name rest-example 'java:8~https://github.com/thorntail-examples/rest-http-redhat#2.2.0-redhat-1'
oc expose svc/rest-example

You can watch the build take place:

oc logs -f bc/rest-example

Once the build completes, wait for the deployment to finish:

oc rollout status -w dc/rest-example

And then access the sample app's UI:

open http://$(oc get route rest-example -o jsonpath='{.spec.host}{"\n"}')

Red Hat Customers using the OpenJDK distribution with Thorntail will be able to keep current with the latest updates, security advisories, knowing when and why containers are updated, and remaining up-to-date on the latest available tagged image.

Documentation

The RHOAR team has been continuously adding and improving on the official documentation for Thorntail. This includes updates in the Release Notes, Getting Started Guide and the new Thorntail Runtime Guide.

Developer interactive learning scenarios

These self-paced scenarios provide you with a pre-configured OpenShift instance, accessible from your browser without any downloads or configuration. Use it to experiment with Thorntail, or learn about other technologies within RHOAR and see how its helps solve real-world problems.

Interactive Learning Scenario for Thorntail
Interactive Learning Scenario for Thorntail
Interactive Learning Scenario for Thorntail

Getting support for Thorntail

Support for Thorntail is available to Red Hat customers through a subscription to Red Hat OpenShift Application Runtimes. Contact your local Red Hat representative or Red Hat Sales for details on how you can enjoy world-class support offered from Red Hat and its worldwide partner network.

Moving forward, customers can expect support for Thorntail and other RHOAR runtimes according to the Red Hat Product Update and Support Lifecycle.

What’s next for Thorntail?

The Thorntail team is continually taking feedback from customers and the wider community of open source developers, as well as tracking the upstream Thorntail releases. They are working to make updates to the RHOAR runtimes based on that feedback, as well as considering support for additional modules from Red Hat and the very large Java community. The Thorntail community is also continuing to track the evolution of and contribute to Jakarta EE as well as the advances in the MicroProfile project.

The people behind Thorntail

This release was produced by Red Hat’s RHOAR product team, and involved many hours of development, testing, writing documentation, testing some more, and working with the wider Red Hat community of customers, partners, and Thorntail developers to incorporate contributions, both big and small. We are glad you have chosen to use it, and hope that it meets or exceeds your expectations!

Thorntail resources

Last updated: January 12, 2024