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 transactional message passing 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 easy 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
...
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
Code Block | ||||
---|---|---|---|---|
| ||||
<model> ... <entities> <entity name="Repository"> <field name="counter" type="Long"/> </entity> </entities> </model> |
...
- Message contains a field named value of type long
- Event contains a field named result of type long.
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
Code Block | ||||
---|---|---|---|---|
| ||||
<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
...
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.