Red Hat

WildFly Swarm 1.0.0.Alpha4 Released!

Once again, we’re delighted and enthralled to announce a release of WildFly Swarm. This time, it’s 1.0.0.Alpha4! That’s like one more than last time!

This release has taken a few months, but it is chock-a-block full of awesome changes. But first, you might be wondering What is WildFly Swarm? Well, it’s WildFly, but dis-assembled and repackaged so that you can consume just the bits’n’bobs you need in order to build slimmer application services and run them from self-contained jars.

What’s Changed?

  • Now based upon WildFly 10.0.0.Beta1

  • Lots of new subsystems/fractions:

    • Clustering

    • EJB

    • JAX-RS Multipart Support

    • JMX

    • JSF

    • Keycloak

    • Logstash

    • Mail

    • Netflix OSS

  • Better source repository layout

  • More tests

  • Arquillian support

NetflixOSS?

In the world of microservices, the NetflixOSS suite of Ribbon and Hystrix make it pretty easy to hide a service behind an interface, find instances of services, and load-balance between them. In the default case, Ribbon uses the Netflix Eureka server to register and discover individual services. With WildFly Swarm, the standard clustering subsystem can be used to locate these services and maintain the lists of end-points. No additional servers are required to be running.

Additionally, Ribbon has been extended to propagate Keycloak authentication tokens across the service calls if you’re also using Keycloak.

Testing with Arquillian

This release also brings integration with Arquillian, the fantastic tool that can not only manage your runtimes, but can inject test code directly into the running system.

Normally Arquillian launches your server, deploys your app, runs your tests (either from outside the running app or within it), undeploys the app, and then stops the server.

Since WildFly Swarm alters the concepts of "server" and "app", we’ve provided tight integration with Arquillian so that the same BuildTool used by the Maven and Gradle plugins is invoked to actually build your uberjar with your application (described by typical Arquillian @Deployment methods) and Arquillian launches it during the 'deploy' phase.

You can still test from outside your app or inside the running process, as we provide support for all the relevant test-enhancers provided by Arquillian.

The Arquillian support is definitely still a work-in-progress, so let us know if you have any suggestions for improving it.

Documentation

We’ve started writing some documentation, which you can contribute to:

Examples?

Yes indeedy! We have a bunch of buildable and runnable examples at GitHub in one handy repository:

What do I download?

There is no special download or installation instructions. Simply start using org.wildfly.swarm artifacts in your pom.xml, throw in the plugin and continue doing your builds.

Stay in Touch

You can keep up with the project through the WildFly HipChat room, @wildflyswarm on Twitter, or through GitHub Issues.

WildFly Swarm 1.0.0.Alpha3 Released!

Once again, we’re delighted and enthralled to announce a release of WildFly Swarm. This time, it’s 1.0.0.Alpha3!

Since this follows quickly on the heels of the last release, there’s not a whole lot of major changes. Rather, we’ve fixed some things, enhanced others, written some tests, and generally knocked it together a little sturdier.

Changes

  • Based on WildFly 9.0.0.CR2.

  • You can now stop() the container.

  • Better classloading for javax.* stuff.

  • JPA improvements:

    • Default datasources are now available.

    • JPA is usable from within a normal WAR.

  • WebSocket API included in the Undertow fraction.

  • More configuration through the wildfly-swarm-maven-plugin.

  • Serve static content (with or without a WAR/JAX-RS deployment).

  • Magical favicon.ico support for JAX-RS deployments, mostly to avoid ugly stack-traces in the console.

Documentation

We’ve started writing some documentation, which you can contribute to:

Examples?

Yes indeed! We have a bunch of buildable and runnable examples at GitHub in one handy repository:

What do I download?

There is no special download or installation instructions. Simply start using org.wildfly.swarm artifacts in your pom.xml, throw in the plugin and continue doing your builds. Everything should be available through Maven Central shortly, and is in JBoss Nexus now for the impatient.

Stay in Touch

You can keep up with the project through the WildFly HipChat room, @wildflyswarm on Twitter, or through GitHub Issues.

WildFly Swarm Alpha2

We’ve been churning through the improvements and fixes for Alpha2!

Windows

All the Windows issues are now resolved. You can enjoy the benefits of WildFly Swarm on your operating system of choice.

Modify your Application from Alpha1

We’ve made a few changes to how the plugin works which means that you will need to update any applications that are already utilizing Alpha1:

  • Remove the execution phase from the wildfly-swarm-plugin

  • Change the goal of the wildfly-swarm-plugin from create to package

  • Remove the provided scope from all WildFly Swarm dependencies in your pom.xml

Weld and JAX-RS

There were some WildFly modules missing when you wanted to use Weld with JAX-RS, so we’ve created a new fraction to cater for this combination. Simply add the following dependency:

<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>wildfly-swarm-weld-jaxrs</artifactId>
  <version>${version.wildfly-swarm}</version>
</dependency>

JPA

This release brings initial support for JPA projects. There are improvements planned for Alpha3 to make it even easier, but right now your project needs to have jar packaging, not war, and you will need your own Main:

public class Main {

    public static void main(String[] args) throws Exception {
      Container container = new Container();
      container.start();

      // Create a JDBC driver deployment using maven groupId:artifactId
      // The version is resolved from your pom.xml's <dependency>
      DriverDeployment driverDeployment = new DriverDeployment(container, "com.h2database:h2", "h2");
      container.deploy(driverDeployment);

      // Create a DS deployment
      DatasourceDeployment dsDeployment = new DatasourceDeployment(container, new Datasource("ExampleDS")
              .connectionURL("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE")
              .driver("h2")
              .authentication("sa", "sa")
      );
      container.deploy(dsDeployment);

      // Create the WAR and bundle all the JPA Entities and persistence.xml
      WarDeployment deployment = new DefaultWarDeployment(container);
      deployment.getArchive().addClasses(Employee.class);
      deployment.getArchive().addClass(EmployeeServlet.class);
      deployment.getArchive().addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml", Main.class.getClassLoader()), "classes/META-INF/persistence.xml");
      deployment.getArchive().addAsWebInfResource(new ClassLoaderAsset("META-INF/load.sql", Main.class.getClassLoader()), "classes/META-INF/load.sql");

      container.deploy(deployment);
    }
}

More ways to run your WildFly Swarm Application!

As with Alpha1 you can run your generated self-contained executable with:

java -jar ./target/myproject-1.0-swarm.jar

With Alpha2 you can also run it from the command line, without building the project:

mvn wildfly-swarm:run

or run the Main class of your application, or org.wildfly.swarm.Swarm if you don’t have one, directly within your favorite IDE!

What do I download?

There is no special download or installation instructions. Simply start using org.wildfly.swarm artifacts in your pom.xml, throw in the plugin and continue doing your builds. Everything is available through Maven Central.

Stay in Touch

You can keep up with the project through the WildFly HipChat room, @wildflyswarm on Twitter, or through GitHub Issues.

back to top