This page presents feed and pipeline examples based on the repository's complex order-book tests. The first example shows a complete three-feed orchestration. The remaining fragments omit handler construction, listeners, waits, and assertions so that the ordering and protocol state carried by the test messages remain visible.
In an integration test, wait for the handler to join each feed and for the stated recovery transition before sending the next phase. The multicast sequence number passed to send is independent of the per-security rptSeq encoded in market-data entries.
The flagship workflow queues an incremental during initial recovery, supplies the instrument definition, completes market recovery from a snapshot, and then sends book, trade-summary, and statistics messages in one incremental packet.
Harness represents the application's test fixture rather than a testing API type. It must provide startHandler, stopHandler, waitForFeed(NetFeedType::Enum), waitForInstrumentRecovery, waitForMarketRecovery, and waitForListenerNotification operations. The supplied FeedSettings must configure Instrument, Incremental, and Snapshot feeds that match the handler.
Each readiness and recovery wait is significant. Sending the next phase before the handler reaches the corresponding state can make an integration test timing-dependent.
In pre-opening mode, a test can publish the security status and definition before adding book levels. Each incremental pipeline sets both the quote boundary and event boundary.
This sequence creates two bid levels for one security. Change the entry type to Offer and invert the price ordering so that prices ascend with the level to build the other side.
A late-join test first sends an incremental that the handler queues, supplies the instrument definition, then sends a snapshot whose lastMsgSeqNumProcessed identifies the last incremental incorporated into that snapshot. The next incremental continues with both the packet sequence and the per-security report sequence advanced.
The test harness should wait for instrument recovery to stop before sending snapshots, and wait for market recovery to stop before asserting the resulting book.
Once the snapshot is applied, the queued incremental is replayed and discarded as outdated; it does not contribute to the resulting book.
The instrument definition's totNumReports is the number of definitions in the instrument-recovery loop. The snapshot's totNumReports is the number of reports in the current snapshot cycle; these are distinct quantities and need not be equal. Each security may have its own rptSeq, but all reports in one coherent cycle normally refer to the same lastMsgSeqNumProcessed.
After the cycle completes, incrementals must continue after lastMsgSeqNumProcessed and use the next report sequence for each affected security.
During one MBP late-join recovery attempt, the handler retains each recovered security until it has collected the expected number of reports. Publish the instrument definitions and wait for instrument recovery to complete first, as in the previous scenario; during normal initial recovery the handler joins the snapshot feed only after instrument recovery succeeds. Repeating an already processed snapshot packet sequence number does not clear retained reports. In this example, the duplicate report for the first security is ignored and the report for the second security completes recovery using the first report already collected.
Duplicate reports for an already recovered security are discarded without their contents being read. To test a genuinely new snapshot cycle, start a new recovery attempt so that the handler clears its recovery state.
A single incremental message may update several securities. EventFlags::EndOfRealQuotes closes the real-quote portion; EventFlags::EndOfEvent closes the entire event. Listener notification behavior then depends on the handler's configured book-update strategy.
Use monotonically increasing rptSeq values independently for each security even when their entries share a packet.
Direct and implied quote boundaries can occur in different packets. The initial message below seeds the direct level required by strict MBP processing. The next message ends real quotes but leaves the event open; the final message ends implied quotes and the event.
This sequence is useful when verifying consolidated-book notifications and end-of-event behavior.
An order-ID entry uses a one-based referenceId to identify the related market-data entry in the same incremental message. The order-ID stage must therefore follow the referenced MBP entry.
Multiple market-data and order-ID stages may be combined in one recipe. Keep each referenceId aligned with the one-based position of its associated market-data entry.
The multicast packet sequence number passed to send and the per-security rptSeq encoded in each entry advance independently. Recipe values are captured when the recipe is built, so construct a fresh recipe for each logical update that advances rptSeq, or factor the common fields into a helper.
Reusing a fully materialized recipe for the same security resends the captured rptSeq; use that only when testing a duplicate or outdated update.