Persisting rule class instances
A risk firewall provides persistence for rule class instances that have been added to it. You do not need to do anything to persist rule class instances; this is the default behavior.
Note: | Risk firewall persistence is completely separate from correlator persistence. That is, rule class instances added to a risk firewall are persistent regardless of whether persistence has been enabled for the correlator. |
A risk firewall itself is not persistent, nor are registered rule classes. Upon correlator restart, you must always re-create the risk firewall and re-register rule classes. After that, the risk firewall restores its rule class instances.
The following information is persistent for each rule class instance that has been added to a risk firewall:
The rule class instance identifier, which was returned when the rule class instance was added.
The name of the registered rule class that the instance was created from.
The configuration parameters for the rule class instance.
If a registered rule class requires additional state information to be persistent, for example, the current position accrued, your application must restore that information before re-registering rule classes. You can use the CMF's
Configuration Service to help you persist rule class data.
A risk firewall also persists and restores the set of objections/warnings that it has issued for evaluated orders. The persistent information includes:
The query order request type (New/Amend/Cancel Order) that this objection/warning was issued against
The query request, which contains information about the original order (orderId, symbol name, service/market/exchange Ids)
The query response, which is the result of the query (the objection/warning, a string that contains the result message)
If an application must be restarted and recovered, it is up to the application to ensure that
Orders are not left in an unknown state. In particular, the following are not persistent:
Queued orders
In-process orders, (submitted but not fully filled and not cancelled)
Pended orders for a risk firewall that is configured for soft rejection
Adapters cancel outstanding orders.
Incoming client orders are cancelled prior to termination, or on recovery if the application was terminated unexpectedly.
If you want to change default behavior and not persist rule class instances, you can change the setting of the CONFIG_ENABLE_PERSISTENCE configuration parameter. This constant value (defined in com.apama.firewall.Consts defines the name of the configuration parameter that indicates whether persistence is enabled for the risk firewall. To change the setting of this parameter, use the CONFIG_ENABLE_PERSISTENCE key and set it to the boolean value you need.