EPAM B2BITS C++ Mit MarketData handler
1.25.0
|
This section describes the creation of a simple MIT application step by step.
Follow these instructions to get it to work:
Execute the following instruction to initialize market data engine.
The engine.properties file is required to read the engine configuration parameters. It must, by default, be present in the current directory. If the file is located elsewhere or has a different name specify the properties file name and path explicitly.
If an error occurs during initialization (the properties file is not found, a required property is missing etc.) the exception will be thrown.
Instance of Mit::Application can be created in two ways:
It is possible to have several instances of Mit::Application created at the same time. All the IO operations of all the services of an instance are processed by the same connection manager. A typical solution is to have a dedicated instance for each market (LSE, JSE, NSX).
Define your application listener class to handle application level events:
Open the instance Mit::Application and specify a pointer to your application listener instance: application->open(&applicationListener);
If the XML configuration file was used, the services defined in it are created and added automatically. You can iterate through them or find a specific service by name:
If the XML configuration file was not used, use must define and add services explicitly:
The application listener is notified on events from the client thread - no synchronization is needed. However, if the same application listener is shared with several applications it may be notified from different concurrent client threads and a synchronization may be needed.
Define your service listener class to handle service level events:
Connect the service to the market data and specify a pointer to your service listener instance:
The service listener is notified on events from different non-concurrent threads - no synchronization is needed. However, if the same service listener is shared with several services it can be notified from different concurrent threads and a synchronization is needed.
application must be destroed using Application::release method or using delete operator. engine must be stopped using B2bits::MD::Engine::destroy()