The Advanced sample shows how to run several CME MDP Premium Market Data Handler instances in one process while sharing common services such as logging, feed engines, and TCP recovery. Use it as a reference for multi-channel applications that need explicit recovery settings, selectable book types, feed configuration, and event tracing.
| Argument | Description | Default |
|---|---|---|
| --channels id1 [id2 [id3 ..]] | Defines the market data channels to process. | 310 |
| --verbose | Prints packet details, instrument events, and formatted contents of enabled order books. | Disabled |
| --skipStartupRecovery | Skips initial market recovery. | Disabled |
| --dontRecoverOnGap | Continues processing on gaps and errors instead of recovering market state from snapshots. | Disabled |
| --withTcpRecovery <user> <password> | Enables TCP Recovery Service for missing packet recovery with the supplied credentials. | Disabled |
| --directBooks | Maintains direct market-by-price books. | Disabled |
| --impliedBooks | Maintains implied market-by-price books. | Disabled |
| --consolidatedBooks | Maintains consolidated market-by-price books. | Disabled |
| --mboBooks | Maintains market-by-order books. | Disabled |
| --connectivity <file> | Uses the specified connectivity configuration file. | ../Settings/config.xml |
| --ifA <interface> | Specifies the network interface for primary feeds. | Not overridden |
| --ifB <interface> | Specifies the network interface for secondary feeds. | Not overridden |
| --failoverForRecoveryFeeds | Switches to secondary recovery feeds when primary recovery feeds stop providing data. | Disabled |
| --arbitrateRealtimeFeeds | Enables real-time feed arbitrage. | Disabled |
| --feedEngine <kind> | Selects the feed engine. Supported values are Socket and Solarflare. | Socket |
| --ioWait <number> | Defines feed engine I/O wait time in milliseconds when supported by the selected engine. | 10 |
| --hardwareTimestamps | Requests hardware timestamps for incoming packets when supported. | Disabled |
| --logFile <filename> | Writes events to the specified log file. | LogFileForAllHandlers.txt |
| --logSeverity Important\|Regular\|Debug | Controls event logging verbosity. | Regular |
| --help | Displays command-line help. | Disabled |
Process the default channel:
Process multiple channels and maintain direct books:
Print detailed market data and direct books:
Enable TCP recovery and write debug logs:
Use the Solarflare feed engine for multiple channels:
By default, console output includes channel start/stop, recovery progress, real-time processing status, warnings, errors, gaps, and worker-thread lifecycle messages. Use --verbose to also print packet headers, match-event flags, instrument definitions, trades, volumes, statistics, quote requests, trading status, and formatted order books.
The --directBooks, --impliedBooks, --consolidatedBooks, and --mboBooks options enable book maintenance independently of --verbose. Book verification and its warnings remain enabled even when book contents are not printed. The --verbose option affects console tracing only; file logging remains controlled by --logFile and --logSeverity.
The sample runs until interrupted with Ctrl+C. Network interface options are usually required on hosts where the default multicast interface is not suitable.
The Solarflare feed engine requires Linux, compatible Solarflare network adapters, and a library built with EF_VI support (WITH_SFFE=ef_vi). Replace eth0 and eth1 in the example with the appropriate Solarflare interfaces. Libraries built with WITH_SFFE=stub report an error when Solarflare is selected.
When using --feedEngine Solarflare with --hardwareTimestamps, you must synchronize the network adapter clock with the system clock before running the sample. Use the Solarflare PTP daemon and wait until it reports that the clocks are synchronized.