Using Reliable Transport
Register Storage Manager (SM) with a Reliable Transport (RT) compatible message bus to receive the table updates and publish the _prtnEnd
signals.
Currently, you are responsible for providing the RT implementation for SM to connect to.
To connect SM to a RT message bus that employs the basic kdb+ tickerplant as an example of RT implementation, start the tickerplant by running
q tick.q sym /tplogs -p 5010
(The destination path for tickerplant log files and the port number 5010 can be arbitrary). The file tick/sym.q
must contain the empty schema for SM internal tables (_prtnEnd
and _reload
) as well as all custom tables to be sent via the tickerplant.
// internal tables
// with `time` and `sym` columns added by RT client for compatibility
(`$"_prtnEnd")set ([] time:"n"$(); sym:`$(); startTS:"p"$(); endTS:"p"$(); opts:())
(`$"_reload")set ([] time:"n"$(); sym:`$(); mount:`$(); params:())
// other tables
trade:([] time:"n"$(); sym:`$(); realTime:"p"$(); price:"f"$(); size:"j"$())
quote:([] time:"n"$(); sym:`$(); realTime:"p"$();
bid:"f"$(); ask:"f"$(); bidSize:"j"$(); askSize:"j"$())
The bus
section of the assembly configuration file needs an entry stream
with protocol
set to custom
for external RT implementation. (The only option currently supported).
bus:
stream:
protocol: custom
nodes: localhost:5010
topic: dataStream
The host and port of the tickerplant are specified in nodes
.
The string specified for topic
is used as a topic for subscribing and registering as publisher (ignored in the basic tickerplant implementation).
SM interacts with the tickerplant using the client library, a q file at the location specified in environment variable KXI_RT_LIB
.
The example script for the basic tickerplant can be adapted for a custom tickerplant implementation.