The Getting Started sample is the smallest complete handler application in this repository. It starts the CME MDP Premium Market Data Handler for one channel, enables direct market-by-price books, and prints direct book updates, making it the quickest path for understanding the basic startup and listener flow.
Arguments
| Argument | Description | Default |
| ChannelId | Positional CME market data channel identifier to process. | Required |
Running Examples
Process channel 310:
Process another channel:
Notes
This sample uses the built-in defaults from samples/Common/Defaults.h: license store ../../license, connectivity file ../Settings/config.xml, and no network interface override. On non-Windows builds, changing NETWORK_INTERFACE_FOR_FEEDS_A and NETWORK_INTERFACE_FOR_FEEDS_B before building overrides the feed interfaces. On Windows builds, this sample does not apply those macros.
Source Code
{
void onBookUpdate(Handler&, const Security&, const DirectBook& book) override
{
std::cout <<
"DirectBook updated:" << std::endl <<
toStr(book) << std::endl;
}
};
int main(int argc, char** argv)
{
std::cout
<< "." << std::endl << std::endl;
if (argc < 2)
{
std::cerr << "usage: [ChannelId]" << std::endl;
return 1;
}
try
{
#if !defined(_WIN32)
checkNetworkSettings(NETWORK_INTERFACE_FOR_FEEDS_A, NETWORK_INTERFACE_FOR_FEEDS_B);
#endif
DirectBookListener listener;
std::cout << "Starting processing market data.." << std::endl << "Press Ctrl+C to stop and exit." << std::endl;
while (!InterruptDetector::instance().detected())
CurrentThread::sleep(1);
std::cout << "Stopping processing market data.." << std::endl;
}
catch (const std::exception& ex)
{
std::cerr << std::endl << "ERROR: " << ex.what() << std::endl;
return 1;
}
return 0;
}