Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Market Data Management : Using MDA with legacy market data components : Creating a Market Data Bridge
Creating a Market Data Bridge
There are two ways to create a Market Data Bridge for legacy adapters:
*Market Data Bridge Service - allows you to simply send one configuration event (com.apama.md.bridge.ConfigMDBridge) to the main context to create a new instance of a Market Data Bridge.
*Market Data Bridge Interface object - creates an instance of the Market Data Bridge as an event object (com.apama,md,bridge.MDBridgeInterface) in an application's monitor. This is useful if you want to use the Market Data Bridge Extensions Interface (com.apama.md.bridge.MDBridgeExtensionInterface) to override some of the behaviour of the Market Data Bridge in your application.
Regardless of which method an application uses, the same event object provides initial configuration. The com.apama.md.ConfigMDBridge event is either sent to the Market Data Bridge Service, or is passed in as a parameter to the Market Data Bridge Interfaces createBridge() action. This event specifies the ServiceId and MarketId of the legacy adapter that is to be bridged, as well as what DataStreams the Market Data Bridge should publish.
The following configuration parameters allow you to alter some of the behaviour of the Market Data Bridge:
*DISABLE_STATUS_SUPPORT - if true, disables the dependency on the underlying adapter publishing com.apama.statusreport.Status messages to inform the Market Data Bridge that it is connected. This option also prevents the Market Data Bridge from publishing any com.apama.statusreport.Status events that come from the underlying adapter. This is useful for legacy synthetic adapters such as the Exchange Simulator. If this parameter is not defined, or is set to false, the Market Data Bridge will check for com.apama.statusreport.Status events from the underlying adapter before the session can be started or stopped.
*SESSIONCONTROL_IGNORES_AVAILABLE –if true, relaxes the dependency on the underlying adapter publishing com.apama.statusreport.Status messages to inform the Market Data Bridge that it is connected. Specifically, it means that the Market Data Bridge will respond to Session Control commands such as Start/Stop on the receipt of a relevant com.apama.statusreport.Status messages. But will ignore the available flag on this message. This is useful for adapters that are slow to start, or that you wish to pend starting them until later. Unlike the DISABLE_STATUS_SUPPORT parameter, this option allows the Market Data Bridge to respond to cases where the underlying Adapter goes down, and republishes the com.apama.statusreport.Status events.
*CONNECTION_TIMEOUT – specifies how long (in seconds) the Market Data Bridges will wait for a response from the underlying adapter before it times out and generates an error. By default, this time out period is 20 seconds. If the Market Data Bridge was created with DISABLE_STATUS_SUPPORT set to true, then this option is ignored. This option can also be configured for the Market Data Bridge on Session Start/Reconfiguration to allow a more dynamic setup.
*ENABLE_THROTTLING – enables the built-in throttling support of the Market Data Bridge. The throttling mechanism that is currently supported uses a “chaser-token” design pattern where, on receipt of a market data event, the Market Data Bridge will enqueue a Throttle-Token event to the contexts input queue. All market data events that are already on the queue will be ignore until the Market Data Bridge receives this Throttle- Token event. This simple mechanism allows the Market Data Bridge to effectively self-regulate the rate at which it needs to throttle (IE it will only throttle when input event rates exceed what it can handle in a timely manner).
*ORDERIDKEY – defines what the OrderId should be when converting the legacy market data events to the MDA Orderbook datastream type. If the parameter defined exists in the extraParams dictionary in the legacy market data event, this value will be used for the orderId in the MDA event. If the parameter contains the string [0-9] then this will be replaced with the current (1-based) book level when checking the extraParams dictionary. For example, setting the ORDERIDKEY to Level[0-9]_OrderId, would cause the Market Data Bridge to look for Level1_OrderId for the Best-Bid/Ask value, and Level2_OrderId for the next level. If this parameter was defined as an empty string, or was not provided, the OrderId will be created
*STATUS_SUBSERVICEID - specifies the subServiceId parameter in the com.apama.statusreport.Status events that the Market Data Bridge is listening for from the underlying Adapter. This parameter is ignored if the DISABLE_STATUS_SUPPORT parameter has been set to true. By default, the Market Data Bridge will be looking for an empty string.
*STATUS_OBJECTID - specifies the ObjectId parameter in the com.apama.statusreport.Status events that the Market Data Bridge is listening for from the underlying Adapter. This parameter is ignored if the DISABLE_STATUS_SUPPORT parameter has been set to true. By default, the Market Data Bridge will be looking for com.apama.statusreport.Status events with an ObjectId of Adapter.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback