Announcement 1.0.0.CR2
What’s New?
-
Welcome Yoshimasa Tanabe (emag) as project committer
-
Arquillian Testing improvement
-
Logging enhancements
-
Drools KIE Server
-
Vert.x
-
Tutorial: Monolith to microservices
Welcome Yoshimasa Tanabe (emag) as project committer
The WildFly Swarm team is pleased to announce that Yoshimasa Tanabe has been added as a core committer to the project.
Thanks for your continued contribution Yoshimasa, keep up the great work!
Arquillian Testing improvements
Previously it was necessary for your test to implement the ContainerFactory
interface and provide an implementation that returns the Container
that
you want to be run for the test.
With this release there is an alternative. A class that implements ContainerFactory
can be independent of the test class using it, such as:
@RunWith(Arquillian.class)
public class MyTest {
@Deployment
public static Archive create Deployment() {
..
}
@org.wildfly.swarm.arquillian.adapter.ContainerFactory
public static Class<? extends ContainerFactory> newFactory() throws Exception {
return MyFactory.class;
}
}
public class MyFactory implements ContainerFactory {
public Container newContainer(String... args) throws Exception {
return new Container().fraction(myFraction.createDefaultFraction());
}
}
We’ve also added support for system properties being set in arquillian.xml
:
<property name="javaVmArguments">-Dsome.property=a</property>
Logging enhancements
System property swarm.logging
now supports all logging levels, not just
DEBUG
and TRACE
.
It’s now possible to set your own handlers in a main() for a logger:
public static void main(String[] args) throws Exception {
Container container = new Container();
LoggingFraction loggingFraction = new LoggingFraction()
.defaultFormatter()
.consoleHandler(Level.INFO, "PATTERN")
.fileHandler(FILE_HANDLER_KEY, "sql-file.log", Level.FINE, "%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n")
.rootLogger(Level.INFO, "CONSOLE")
.logger("wildflyswarm.filelogger", l -> l
.level(Level.FINE)
.handler(FILE_HANDLER_KEY)
.useParentHandlers(false));
container.fraction(loggingFraction);
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
deployment.addPackage(App.class.getPackage());
container.start().deploy(deployment);
}
Drools KIE Server
Though it’s not currently part of the BOM, you can try out the Drools KIE Server by including the following dependency:
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>drools-server</artifactId>
<version>1.0.0.Alpha1</version>
</dependency>
and packaging it into a WF Swarm jar to execute!
Vert.x
Though it’s not currently part of the BOM, you can try out the Vert.x integration by including the following dependency:
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>vertx</artifactId>
<version>1.0.0.Alpha1</version>
</dependency>
The fraction deploys a JCA adapter providing both outbound and inbound connectivity with a Vert.x instance. An application component (e.g Servlet, EJB), can send messages to a Vert.x instance using the Vert.x EventBus.
Usage:
@Resource(mappedName="java:/eis/VertxConnectionFactory")
VertxConnectionFactory connFactory;
public void sendMessage() throws Exception {
try (VertxConnection conn = connFactory.getVertxConnection()) {
conn.vertxEventBus().send("tacos", "Hello from JCA");
}
}
Inbound connectivity is provided via a listener interface which can be implemented by a Java EE Message Driven Bean (MDB). As opposed to the default JMS listener type, the Vert.x JCA listener interface allows an MDB to receive messages from a Vert.x address.
Usage:
package io.vertx.resourceadapter.examples.mdb;
import io.vertx.resourceadapter.inflow.VertxListener;
import io.vertx.core.eventbus.Message;
import java.util.logging.Logger;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import org.jboss.ejb3.annotation.ResourceAdapter;
@MessageDriven(name = "VertxMonitor",
messageListenerInterface = VertxListener.class,
activationConfig = {
@ActivationConfigProperty(propertyName = "address", propertyValue = "tacos")
}
)
@ResourceAdapter("vertx-ra")
public class VertxMonitor implements VertxListener {
private static final Logger logger = Logger.getLogger(VertxMonitor.class.getName());
@Override
public <String> void onMessage(Message<String> message) {
logger.info("Get a message from Vert.x at address: " + message.address());
logger.info("Body of the message: " + message.body());
}
}
See the vert.x README notes for more information
Tutorial: Monolith to microservices
The workshop contents from the Devoxx UK lab are available now. In this lab we will introduce you to WildFly Swarm through the migration of a Java EE monolith application to microservices for parts of the stack. The services will be discoverable, provide failover with Netflix Ribbon and utilize Netflix Hystrix for circuit breaking amongst other things.
Visit Tutorial
Changelog
Release notes for 1.0.0.CR2 are available here.
- [ SWARM-237 ] Document the programmatic configuration of the DataSources
- [ SWARM-477 ] Allow user control of default binding java:jboss/DefaultJMSConnectionFactory
- [ SWARM-479 ] Hot Swap of static content for JAXRSArchive doesn't work
- [ SWARM-480 ] Upgrade to wildfly-swarm-camel-1.0.4
- [ SWARM-485 ] Using a JAX-RS provider that extends JacksonJaxbJsonProvider throws a java.lang.NoClassDefFoundError Link Error
- [ SWARM-487 ] Configure Container in Arquillan tests using annotation
- [ SWARM-488 ] CLI Support with Maven
- [ SWARM-489 ] Simplify dependency requires for fraction modules
- [ SWARM-490 ] Add @ContainerFactory annotation for Arquillian
- [ SWARM-493 ] Default configuration of ConsulTopologyFraction does not include default URL.
- [ SWARM-496 ] Upgrade to ShrinkWrap 1.2.4
- [ SWARM-497 ] NPE when closing TempFileManager
- [ SWARM-498 ] container.createDefaultDeployment().as(JAXRSArchive.class) does not package classes in WEB-INF/classes
- [ SWARM-500 ] Can't Run javaee7-samples Stateless EJB Example
- [ SWARM-501 ] system property swarm.logging supports more levels
- [ SWARM-502 ] JAAS Security Form examples fail when running -uber examples
- [ SWARM-503 ] Stages Configuration should fall back to default property if there is not a stage property
- [ SWARM-504 ] Support passing system properties to the Wildfly Swarm Arquillian Container using arquillian.xml
- [ SWARM-505 ] Attributes cannot be added to HealthStatus within a HealthResource
- [ SWARM-507 ] Autodiscover external configuration files
- [ SWARM-510 ] javax.resource.* classes are not resolved during compile time from resource-adapter fraction
- [ SWARM-511 ] Shrinkwrap UnknownExtensionTypeException for ExplodedExporter
- [ SWARM-512 ] Failure in -uber-examples to find main() in a WAR
- [ SWARM-515 ] Can't set handlers for a logger
- [ SWARM-516 ] Auto detection scans transitive dependencies of fractions
- [ SWARM-517 ] Jandex class missing when overriding method in org.wildfly.swarm.spi.runtime.ServerConfiguration
- [ SWARM-518 ] Upgrade to Keycloak 1.9.8.Final
- [ SWARM-519 ] @ResourceAdapter is not available with EJB fraction
- [ SWARM-520 ] Auto Detection to support Class as well as Package
- [ SWARM-522 ] Cannot pass jvmArguments to multistart process configuration
Resources
Per usual, we tend to hang out on irc.freenode.net
in #wildfly-swarm
.
All bug and feature-tracking is kept in JIRA.
Examples are available in https://github.com/wildfly-swarm/wildfly-swarm-examples/tree/1.0.0.CR2.
Documentation for this release is available.
Thank you, Contributors!
We appreciate all of our contributors since the last release:
Core
-
Heiko Braun
-
Toby Crawley
-
Thomas Diesler
-
Ken Finnigan
-
George Gastaldi
-
Marco Hofstetter
-
Richard Lucas
-
Bob McWhirter
-
Alex Soto
-
Yoshimasa Tanabe (emag)
Non Core
-
Heiko Braun
-
Ken Finnigan
-
George Gastaldi
-
Bob McWhirter
Examples
-
Heiko Braun
-
Thomas Diesler
-
Ken Finnigan
-
Bob McWhirter
-
Alessio Soldano
-
Yoshimasa Tanabe (emag)
Documentation
-
Toby Crawley
-
Ken Finnigan
-
Marco Hofstetter
-
Thomas Wölfle