Apama 10.3 | Apama Capital Markets Foundation Documentation | Capital Markets Foundation | Analytics | Using the position service framework | Position service framework and persistence
 
Position service framework and persistence
By default, the position service framework persists subscriptions and their position information for the default open position tracker. All subscriptions to the default open position tracker that are active in an application that shuts down will be recovered when the application restarts.
Suppose you subscribe to a default open position tracker, then unsubscribe from that tracker, and then the application shuts down. Restarting the application does not cause recovery of that subscription.
By default, the position service framework does not persist subscriptions to the default pending and reserved position trackers. These trackers monitor orders that are active in the market. If persistence is enabled for these trackers and you shut down the correlator before these orders are filled you would recover a stale position.
If an application does not require recovery of persisted position information, it can disable persistence through the CMF Service Framework (which is the same for all CMF components that support persistence). The following code extract shows how to do this:
package com.apama.cmf.demo;
 
monitor DisablePersistence {
context mainContext := context.current();
constant string TRACKER_NAME := "MyTracker";
string TRACKER_TYPE :=
com.apama.position.tracker.OpenPositionTrackerConstants.TRACKER_TYPE;
 
action onload() {
// The Service Framework ServiceParameters() event must be sent to
// the main context prior to creating the position tracker instance.
dictionary<string,string> serviceParams :=
{com.apama.position.Constants.ENABLE_PERSISTENCE_KEY:"false"};
route com.apama.service.framework.ServiceParameters(
"MyPositionTracker",
com.apama.position.tracker.OpenPositionTrackerConstants.TRACKER_TYPE,
serviceParams );
(new com.apama.position.tracker.OpenPositionTrackerFactory).create(
mainContext, "MyPositionTracker", cbCreatedTracker );
}
 
action cbCreatedTracker( boolean success, string msg ) {
log "Open Position Tracker created without Persistence:
"+success.toString();
}
}

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.