Talon provides the machinery to easily build, run and manage micro applications (‘micro app’). A micro app is a lightweight, stateful message processor that resides on a messaging fabric. A micro app stores state as Java objects entirely in local memory and collaborates with other micro apps using guaranteed eventing via its underlying messaging fabric.


The Talon runtime uses configuration information to connect to the messaging fabric and drive the business logic embodied in the micro app message handlers in an exactly once, fully fault tolerant manner. Application developers just implement message handlers. The Talon runtime dispatches inbound messages to the appropriate handlers, the handlers execute business logic, update state and send outbound messages to downstream apps. Talon enables the following for a developer

By enabling this, Talon makes it extremely ease for the developer to author streaming, multi-agent apps that are fault tolerant, scalable and perform at memory speeds. 

A Simple App

Lets say, for example, a developer would like to write an app that performs the following

To implement such an app using Talon, the developer would do the following:

  1. Model the app state and messages in XML 
  2. Integrate the X code generator into the app's build process generate message and state POJOs
  3. Author a message handler that updates the state and sends the outbound message

Thats it. The rest - app lifecycle, message bus connectivity, serialization/deserialization, state persistence, HA, etc - are all taken care of by the Talon runtime.

Model State

<model>
    ...
    <entities>
        <entity name="Repository">
            <field name="counter" type="Long"/>
        </entity>
    </entities>
</model>

The state is comprised of a single root Repository object with a counter value in it.

Model Messages

<model>
    ...
    <messages>
        <message name="Message">
            <field name="value" type="Long"/>
        </message>

        <message name="Event">
            <field name="result" type="Long"/>
        </message>
    </messages>
</model>

The above model defines a Message  and Event message.

Convert to POJOs

The above XMLs are converted to POJOs as part of the app's build process. The following illustrates how this is done using the Talon's Maven code generator plugin

    <build>
        <plugins>
            <plugin>
                <groupId>com.neeve</groupId>
                <artifactId>nvx-core-maven-plugin</artifactId>
                <version>${nvx.talon.version}</version>
                <executions>
                    <execution>
                        <id>State</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <modelFile>${project.basedir}/src/main/models/com/neeve/talon/starter/state/state.xml</modelFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.neeve</groupId>
                <artifactId>nvx-core-maven-plugin</artifactId>
                <version>${nvx.talon.version}</version>
                <executions>
                    <execution>
                        <id>Messages</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <modelFile>${project.basedir}/src/main/models/com/neeve/talon/starter/messages/messages.xml</modelFile>
                            <encodingType>Xbuf</encodingType>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Write Application Logic

The following is the message handler that executes the application logic

@EventHandler
public void onMessage(Message message, Repository repository) {
    repository.setCounter(repository.getCounter() + message.getValue());
    Event event = Event.create();
    event.setResult(repository.getCounter());
    sender.sendMessage(“events”, event);
}

Thats it! Thats all the developer has to do and you have a fault tolerant, highly performant stateful message processor ready to go.

What is most significant about the code above is how messaging, storage and transaction processing are fully integrated using Java without compromising on the non-functional aspects of the application. The X Platform ensures that the above code is invoked exactly once for an inbound message, is horizontally scalable and fully fault tolerant with zero data loss on process, machine or data center failure. It is this capability to enable fully integrated stateful and collaboration aware code without non-functional compromise that unleashes the full potential and power of multi-agent systems.

Ready To Get Hands On?

Click HERE to get started with Talon.