Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Market Data Management : Using low-level MDA interfaces : Creating a market data manager
Creating a market data manager
First obtain an MDManager object, which can then be used to query and connect to a specific session.

// This action is called when the Session was successfully started
action onSessionStartSuccess(integer sessionId) {

// Create a new Market Data Manager for this session
(new com.apama.md.user.MDManagerFactory).createMDManager(
Once the manager has been created successfully, you can query the availability of the required datastream and if available, use the relevant datastream manager to access that specific datastream. The following is a list of the available actions for the built-in datastream types:
*hasBBA(), createBBAManager()
*hasTrade(), createTradeManager()
*hasDepth(), createDepthManager()
*hasOrderbook(), createOrderbookManager()
*hasQuote(), createQuoteManager()
*hasQuotebook(), createQuotebookManager()
*hasEP(), createEPManager()
Alternatively, you can query session capabilities to see if a specific datastream type is available. This can be done by using the com.apama.session.SessionInfo object for the session and calling sessionInfo.getCapabilities().hasDatastream( streamType) on its interface. This method means that you can query a session's datastream capabilities quickly without needing to create MDManagers first. For example, to access the best-bid-ask (BBA) datastream, the following code would be required in order to obtain the relevant manager.

// this action is called if the creation of the MD manager was successful
action onCreationSuccess( com.apama.md.user.MDManagerInterface mdManager ) {

// Now create a new interface to the BBA Manager
if mdManager.hasBBA() then {
BBAManagerInterfacebba bbaManagerIface :=
connect( bbaManagerIface );
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback