The Talon Manual

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

State Replication is the simpler of Talon's 2 High Availability models. With State Replication Talon replicates changes to state and the outbound messages emitted by your application's message handlers. In the event of failover to a backup your application's state is available at the same point where processing left off, and the engine will retransmit any outbound messages that were left in doubt as a result of the failure. Similarly when recovering from a cold start your application builds back up your application's state by replaying persisted deltas and recovering undelivered outbound messages from the application's transaction log. 

Coding For State Replication

...

Code Block
languagexml
titleDeclaration in Config DDL
<app name="processor" mainClass="com.sample.Application">
  <messaging>
    <factories>
      <factory name="com.sample.messages.MessageFactory"/>
    </factories>
    <buses>
      <bus name="sample-bus">
        <channels>
          <channel name="requests" join="true">
          <channel name="events" join="false">
        </channeks>
      </bus>
    </buses>
  </messaging>
  <storage enabled="true">
    <factories>
      <factory name="com.sample.state.StateFactory" />
    </factories>
 </storage>
</app>

...

For applications that use state replication with an unsolicited sender (i.e. those not done from a message handler) such as the Feeder app, the application should additionally configure the engine to replicate unsolicited sends so that state and messages are replicated for the sender. The Feeder is such an application, so it additionally sets this value to true:

descriptor.setReplicateUnsolicitedSends(true);
Code Block
languagexmljava
xml
<app name="processor" mainClass="com.sample.Application">
  ...
  <replicateUnsolicitedSends>true<replicateUnsolicitedSends
</app>




 

 

Anchor
_Creation_of_Application
_Creation_of_Application

...