Turbo
The VLINGO XOOM adoption and project accelerator for Java and other JVM languages.
This VLINGO XOOM component helps individual developers and architects, as well as whole teams, to speedily jump-start productivity with the platform. Our JVM SDK boosts productivity in building high-scale, high-performance, Reactive microservices and well-modularized monoliths. Our Designer helps you models and deliver your project structure for each of your subsystems, such as Microservices: REST resource handlers; domain model aggregates/entities; events and state objects; Event Sourcing and CQRS command and query models; and persistence mechanisms.

XOOM Turbo is a container around the platform components, making use fast and simple.
Starting with from visual model definition, REST API, persistence, and container definitions, to generation, to immediate build and run, your services can be running within minutes.
A very important aspect of VLINGO XOOM is that all runtime wiring is achieved at compile time, not at startup time. This leads to very fast startup times for your services and applications. This means that adding new runtime nodes to your deployed system is performed very quickly. It also means that using the platform for FaaS-based solutions is a realistic and viable option.
This is achieved in one of two ways.
- Handwritten code including all necessary bootstrap boilerplate
- Annotations that wire at compile-time, not runtime, and replace almost all of the handwritten boilerplate code
Although we are not fans of sprinkling Java annotations all over a codebase, we have found that supporting a few key annotations greatly reduces the amount of boilerplate code, including configuration and startup initialization, that is required. The use of annotations is completely optional. You may choose to implement all of the configuration and initialization code yourself. Yet, we think you will agree that using a few annotations in key places is more helpful than objectionable. And, of course, if you are a fan of annotations, you will find them indispensable.
We have even more good news. Most of the bootstrap, startup, configuration, and initialization code, may be generated for you—with or without annotations—when using the VLINGO XOOM Designer.
We have found that one of the blockers to learning reactive programming is, well, non-blocking. As a large body of programmers, the software industry has mostly supplied and socialized blocking or synchronizing languages and tooling. Because of this, developers have come to expect blocking—and for many of us that write software in teams—you've certainly inherited and contributed to blocking code in your projects. This legacy of blocking becomes continually more difficult to change. For these reasons, it comes as no surprise that a non-blocking approach will require a cooperative mind-bending effort for teams to fully adopt an asynchronous, concurrent, and parallelized programming culture.
For this reason, we've decided to introduce a familiar way to learn the different components of the VLINGO XOOM SDK—without the need to fully utilize asynchrony early on. We're keen on providing you with the stepping stones that help you and your team make the jump to asynchrony, concurrency, and parallelism, without the added burden of learning an entirely new way of writing code. We welcome you to explore our VLINGO XOOM tools so you can quickly learn the ropes, gradually adding in asynchrony as you feel more comfortable.
It is our hope that this project will help you realize our platform's overarching goals of aggressive simplicity combined with lightweight fluency, with or without adopting Domain-Driven Design. After all, the best way to learn any language is to learn both the words and the grammar as you go, achieving fluency through both rapid and gradual practice.
Messaging is at the core of VLINGO XOOM, and as such, still uses messaging in the same way that you would with our asynchronous environment, but it conceals the learning discomfort.
There's no mystery to actors and message sending. Here's a brief explanation of how actor messaging works, but with synchronous, single-threaded programming. Assume that a sending actor sends a message to a receiving actor. The receiving actor will see the message from the sending actor and react to it. After reacting to the message, the receiving actor will then return control back to the sending actor on the same thread.
Now consider that the receiving actor is a request handler that provides an HTTP response. As non-reactive blocking communication goes, all requests to the handler will be served responses on the same thread. It's easy to understand.
The only difference in this explanation above, to what you might be used to, is the idea of using actors as an abstraction instead of HTTP-based web services. Whether or not the underlying protocol, servlet, container, or driver enables reactive or blocking communication, the actor programming model itself is unchanged. An actor is an object that receives messages and sends messages in response.
Now, take a look at the VLINGO XOOM SDK to get started making strides toward full use of the full array of components.
To begin, you need the following dependency for your builds, the first being for Maven.
<dependency>
<groupId>io.vlingo.xoom</groupId>
<artifactId>xoom-turbo</artifactId>
<version>x.y.z</version>
<scope>compile</scope>
</dependency>
The second is for Gradle. In both examples, replace
x
, y
, and z
with the major version, minor version, and patch version, respectively, for the artifact.dependencies {
compile 'io.vlingo.xoom:xoom-turbo:x.y.z'
}
You also need the configuration defined in the properties file
xoom-actors.properties
that is already provided when you use Designer for generating your project. In case you prefer to create it manually, the Actors documentation will be very useful.To boot the VLINGO XOOM platform foundation, use the
Boot
API. There are three ways to do so. One way is through a void main(String[] args)
boot method.Boot.main(new String[] { "xoom-boot-world-name" });
final World world = Boot.xoomBootWorld();
Of course the
main()
would normally be invoked by the Java runtime. This demonstrates that if any command-line arguments are received, the first argument will be used to name the World
. If there are no command-line arguments, the World
will be named "vlingo-xoom"
.A second way to boot the platform is to use the
Boot.start(String name)
method.final World world = Boot.start("xoom-boot-world-name");
The last and simpler way is to annotate a clean Java class with
@Xoom
annotation:@Xoom(name="xoom-boot-world-name")
public class AppInitializer {
}
As you can see,
@Xoom
does not require any method implementation because the annotation itself is sufficient to boot the application. Furthermore, you can add the blocking
attribute to enable/disable synchronous actor messaging.@Xoom(name="xoom-boot-world-name", blocking=true)
public class AppInitializer {
}
Keep in mind that the default value for
blocking
is false
and, when used, @Xoom
annotation attributes always override what has been set in xoom-turbo.properties
. In other words, if the Initializer class is annotated with blocking=false
and BlockingMailbox
is enabled in the properties file, the @Xoom
attribute prevails, causing actors to communicate asynchronously.One of the many cool things about VLINGO XOOM, whether using the XOOM Turbo container or the other component APIs directly, is that it boots within a few milliseconds. How cool is that? And you know that everybody loves cool!
Now you are ready to use the
World
and any living part of it to explore the marvels of the platform.Messaging is accomplished the same simple way that it is with our standard platform environment. There are no surprises. Consider an example with a
DeliveryProtocol
.public interface DeliveryProtocol {
void reactTo();
void reactTo(final int x, final int y, final int z);
void reactTo(final String text);
Completes<List<String>> reactions();
}
This protocol provides three command messages and a forth used for querying. The actor that provides this protocol can react in three ways: using no parameters, three integer parameters, and with one text string parameter. Here is an actor that implements this protocol.
public class DeliveryProtocolActor extends Actor implements DeliveryProtocol {
private final List<String> reactions;
public DeliveryProtocolActor() {
this.reactions = new ArrayList<>();
}
@Override
public void reactTo() {
final String reaction = "reacting to no parameters";
logger().debug(reaction);
reactions.add(reaction);
}
@Override
public void reactTo(final int x, final int y, final int z) {
final String reaction = "reacting to: x=" + x + " y=" + y + " z=" + z;
logger().debug(reaction);
reactions.add(reaction);
}
@Override
public void reactTo(final String text) {
final String reaction = "reacting to: text=" + text;
logger().debug(reaction);
reactions.add(reaction);
}