The simulator stops at the adapter seam

Table of Contents

1. Summary

The simulator imitates what a vendor delivers. It does not imitate how the vendor delivers it. It reproduces vendor ids, field names, vendor time and realistic failure behaviour. It does not reproduce the blpapi session, the Elektron wire formats or vendor authentication.

2. Detail

2.1. Three levels of fidelity

Level Covers Decision
Data Ids, fields, vendor time, tick rates, market hours, stale values, gaps, bad ticks Build
Adapter contract Announce, demand, tick, heartbeat Build
Vendor protocol Sessions, wire formats, authentication Do not build

2.2. Why the seam is the limit

  • A live adapter turns a vendor protocol into the adapter contract. Everything behind the seam is the service's own. A protocol simulator would test only the translation code of a live adapter.
  • Vendor protocols are large and they change. A copy would be a project of its own.
  • The rule in No code path may behave differently because a source is simulated holds at the seam.

2.3. Fault injection

The simulator can fail the way a vendor fails. A generator can drop a connection, delay ticks, repeat ticks, send a value outside the range, or reject an id with not_entitled. These faults go through the adapter contract, so the checks in Quality checks run between mapping and storage and ignore the source kind and the state changes in The adapter lifecycle are tested against them.

2.4. Replay

A replay adapter reads recorded vendor ticks and publishes them. It is another adapter of kind replay. It is the way to test the protocol code of a future live adapter, and it needs no change in the service.

3. See also

Emacs 29.3 (Org mode 9.6.15)