Announcing WildFly Swarm 2016.12.0

It’s December, WildFly Swarm 2016.12.0 swings in like a monkey.

Since December 14th is Monkey Day (look it up!), we’re shipping WildFly Swarm 2016.12.0 with a side-dish of bananas. Bananas.

What’s New?

  • More configurability

  • Bring-You-Own JDBC driver

  • Improvements to the health/monitoring

  • Improvements to OpenShift support

  • Fluentd logging support

What is WildFly Swarm?

WildFly Swarm is the decomposition and reconstitution of the popular WildFly Java Application Server in order to support just enough appserver for microservice type applications.

Each portion of the appserver is referred to as a fraction, which many times maps to a subsystem from WildFly, but also may include other discrete chunks of non-Java EE or WildFly functionality, such as Swagger, or Jolokia.

More Configurability

Some time was spent to make everything more consistently configurable without requiring you to write your own main(…​) method. While we’ve supported project-stages.yml and Java system properties for a while, the things that were configurable using them was hit-or-miss.

Now, through project-stages.yml you can accomplish most any configuration of fractions that would’ve normally required a main(…​). When booting up your application, you’ll now see a rather verbose set of output, similar to:

...
swarm.management.http-interface-management-interface.socket-binding = management-http
swarm.management.http.port                                          = 9990
swarm.management.https.port                                         = 9993
swarm.request-controller.active-requests                            = (unset)
swarm.request-controller.max-requests                               = (unset)
swarm.request-controller.track-individual-endpoints                 = (unset)
swarm.undertow.alias                                                = (unset)
swarm.undertow.buffer-caches.default.buffer-size                    = (unset)
swarm.undertow.buffer-caches.default.buffers-per-region             = (unset)
...

We currently display all configurable items, even if unset. If you have a main(…​) with customizations, those customizations will be visible during boot. For those of you who are security-minded, we also redact any configuration item that might be a password.

The naming of the configuration items follows the structure of the Fraction APIs you may have already been using to configure your application. While these names are as dotted properties, and can be ultimately set using -Dkey=value on the command-line, they also represent the YAML tree you can use from within a project-stages.yml file.

swarm:
  management:
    http:
      port: 9990
    https:
      port: 9993

The general format is

swarm:
  fraction-name:
    # fraction attribute
    attribute-key: value
    # collection of subresources
    subresource-type:
      subresource-key:
        attribute-key: value
    # singleton subresource
    subresource-key:
      attribute-key: value

Additionally, you now use project-stages.yml not only to configure existing components, but it may be used to create new configured components. This is primarily thought to be useful for defining items such as datasources.

swarm:
  datasources:
    data-sources:
      MyDS:
        driver-name: myh2
        connection-url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
        user-name: sa
        password: sa
      MyOtherDS:
        driver-name: myh2
        connection-url: jdbc:h2:mem:other-test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
        user-name: sa
        password: sa

Bring-your-own JDBC driver

WARNING: Breaking change!

Previously we provided Maven artifacts that transitively brought in particular JDBC drivers to make it easier to integrate them with the underlying WildFly datasources subsystem. This was problematic due to the fact that we had to select specific versions of a given driver and also couldn’t support non-freely-available drivers.

We have completely removed our DB driver fractions. They are gone.

You now get to bring your own JDBC driver. In fact, you must bring your own JDBC driver. All that’s required though is just adding it as a normal Maven dependency to your project.

e.g.

<dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
  <version>1.4.187</version>
</dependency>

That being said, we have replaced our own inclusion of specific versions of specific drivers with enough logic to handle the setup of the WildFly driver, the creation (at runtime) of the relevant module.xml to load it.

We now auto-detect the following database JDBC drivers and attempt to configure them correctly:

  • H2

  • MySQL

  • PostgreSQL

  • EnterpriseDB

  • Oracle

  • SQLServer

  • Sybase

  • DB2

This includes noticing if you have a DB2 license jar because you’re connecting to an AS/400 or whatnot.

That being said, we haven’t access to a few of the non-freely-available databases, so we welcome reports of any issues discovered.

Health checks

WARNING: Breaking change!

The health check API and protocol has been updated to make it easier to use. Unlike the prior version, /health now aggregates all checks and returns a combined response with a single outcome. You would still expose health checks using JAX-RS resources, but you only need to know /health as the entry point for clients to verify the liveliness of your node (i.e. kubernetes). Along these lines, we’ve removed CompositeHealthStatus, because that’s implied by the former.

Security has been simplified as well. It’s now an all-or-nothing approach. If you define a security realm all endpoints will be secured, as such the attribute inheritSecurity on @Health has been removed.

Checks now require an ID (or name) to identify them in composite responses. Hence the builder API on HealthStatus has been modified to reflect this.

Taking everything into account, the wireformat has changed slightly as well. A regular response, now looks like this:

{
    "checks": [
        {
            "data": {
                "freebytes": 35445936128
            },
            "id": "diskspace",
            "result": "UP"
        },
        {
            "data": {
                "date": "Fri Dec 02 09:50:12 CET 2016",
                "time": 1480668612010
            },
            "id": "something-else",
            "result": "UP"
        }
    ],
    "outcome": "UP"
}

Changelog

Release notes for 2016.12.0 are available here.

Bug

  • [SWARM-864] Ensure BYO JDBC works with Windows paths. (Done)

  • [SWARM-862] Multi Module Api in testsuite is not added to repo, so breaks when doing mvn dependency:tree (Done)

  • [SWARM-860] Health examples fail with NoClassDefFoundError: org/jboss/dmr/ModelNode (Done)

  • [SWARM-858] additional fractions: unintuitive behavior if the fraction is not found (Done)

  • [SWARM-857] Secured Ribbon client gets CNFE on KeycloakSecurityContextAssociation when trying to propagate Bearer token (Done)

  • [SWARM-854] fraction autodetection is hard to debug (Done)

  • [SWARM-853] @DefaultDeployment bungles paths on Windows (Done)

  • [SWARM-850] forgotten System.getProperty calls after the @Configurable conversion (Done)

  • [SWARM-848] ServiceName ClassLoading issue with TopologyWebAppActivator (Done)

  • [SWARM-846] Topology ProxyService’s are never started (Done)

  • [SWARM-845] Unsatisfied dependencies for type RemotingFraction (Done)

  • [SWARM-844] Gradle project dependencies with 2 colons are resolved as jar dependencies (Done)

  • [SWARM-833] bad default mod_cluster multicast address (Done)

  • [SWARM-825] Container :api and :runtime modules don’t include/exclude correct packages (Done)

  • [SWARM-744] Failed to process logging directory /. Log files cannot be listed (Done)

  • [SWARM-698] Example README doc code does not match actual code (Done)

  • [SWARM-612] jboss-cli reload results in 404 / no deployment (Done)

  • [SWARM-610] The wildfly-self-contained.d directory lingers. (Done)

  • [SWARM-204] Exception when connecting Jolokia JVM agent. (Done)

Enhancement

  • [SWARM-851] add a test that a custom main method in a WAR project is actually executed (Done)

  • [SWARM-739] Formalize configuration values (Done)

  • [SWARM-714] Hide Fractions from developer that are just exposing WF modules, such as jaxrs-cdi (Done)

  • [SWARM-693] Provide one well known default health check entrypoint (Done)

  • [SWARM-688] Don’t show internal Fractions in list at container startup (Done)

Task

  • [SWARM-823] [spike] Scope & Review the ability to bring your own DB/JBDC (Done)

Component Upgrade

  • [SWARM-810] Update to latest OpenShift Client in topology-openshift (Done)

  • [SWARM-686] Update to WF Core 2.2.1 (Done)

Feature Request

  • [SWARM-723] Fraction for FluentD to integrate with EFK stack (Done)

Resources

Per usual, we tend to hang out on irc.freenode.net in #wildfly-swarm.

All bug and feature-tracking is kept in JIRA.

Documentation for this release is available.

Thank you, Contributors!

We appreciate all of our contributors since the last release:

Documentation

  • Heiko Braun

  • Ken Finnigan

  • Bob McWhirter

Examples

  • srinivasavasu

  • Heiko Braun

  • Ken Finnigan

  • Bob McWhirter

  • Ladislav Thon

Core

  • Heiko Braun

  • Alexander Egger

  • Ken Finnigan

  • Bob McWhirter

  • Ladislav Thon