KDB¶
Prerequisites¶
Be sure that KDB is running before adding as a data source. Fully tested versions include 3.x
Configuring KX live streaming inside AMI Relays¶
KX live streaming integrates with kdb+tick via the AMI Feed handler mechanism. AMI can be configured to connect and subscribe to KX ticker plants. This enables AMI to receive all real-time updates from the ticker plant. Optionally, AMI can also be configured to recover from ticker plant log files before consuming real time updates.
Ami Relay Property Settings for KX feed handler¶
The following properties should be set in ami relays' config/local.properties
As with all feed handlers, add one uniquely named entry for each KX feed handler to the ami.relay.fh.active property. Be sure to include the default ssocket,cfg and cmd feed handlers. For example if you have only one kx feed handler:
Then, for each KX feed handler, include the following properties. NOTE: Be sure to include the proper feed handler name in the property name:
- See the __CONNECTION table docs for explanation on application ids
Example Config¶
Example Setup¶
-
Suppose on the kx side, we have a publisher and a subscriber, where inside the publisher we have a kx table called kx
Refer to the kx docs for detailed instructions on how to set up a publisher and a subscriber in kx.
-
Launch publisher.q on port 1000 and subscriber.q on port 1001
-
on the Ami side, in the amione/config/local.properties
Note here that the kxUrl is the publisher port number and the argument inside u.sub is the kx table name.
Also note that we don't need to create the table in AMI upfront because the feedhandler will create it for you.
KDB Ticker Plant Recovery Steps¶
In order to support replay you must startup a KDB replay process that will be used by the AMI Relay feed handler to recover data from the ticker plant log file before resuming processing of real time events from the ticker plant.
IMPORTANT: This KDB process must have read access to the ticker plant log file.
Setup process: Create a script called replay.q with the following contents:
Startup Process: (where server_port matches port in ami.relay.fh.kx1.props.replayUrl
):