roq-journal¶
$ conda install \
--channel https://roq-trading.com/conda/unstable \
roq-journal
$ conda install \
--channel https://roq-trading.com/conda/stable \
roq-journal
roq-journal¶
$ roq-journal [FLAGS]
Description¶
roq-journal supports distributed persistence of order requests and updates.
Listens for multicast
OrderAckandOrderUpdatemessages.Appends messages to a journal on the local filesystem.
Inserts messages into relevant database tables.
Acknowledges receipt by sending a UDP message to the original sender of the received message.
Replays the local journal after restart.
Any number of roq-journal instances can be deployed to lower the round-trip latency and to reduce the risk of data loss.
The local journal can be synchronized before or after acknowledging receipt, or not at all.
Note
roq-journal was designed to support low-latency persistence of client order-id mappings
(routing_id).
This is specifically required to support the OrderCancelRequest <F> and
OrderCancelReplaceRequest <G> FIX messages.
Flags¶
$ roq-journal --help
--nameService name
--cache_dir(roq-cache)Cache directory (path)
--cache_retain_for(48h)Retain cache files for this period
--cache_datasync(false)Enable filesystem sync?
--cache_datasync_before_respond(false)Issue filesystem sync before responding? (depends on –cache_datasync)
--multicast_portMulticast port
--multicast_addressMulticast address
--local_interfaceLocal interface
--buffer_size(2048)Buffer size
--database_uri(http://localhost:8123)Database URI
--database_usernameDatabase username
--database_passwordDatabase password
--database_nameDatabase name
--loop_cpu_affinity(-1)CPU affinity for the main dispatch thread
--loop_sleep(500ns)Sleep period for the main dispatch thread
--loop_timer_freq(2500ns)Timer frequency
--service_listen_addressListen address
--service_url_prefixURL prefix
--service_session_timeout(5s)Session time-out period
roq-journal-admin¶
$ roq-journal-admin [FLAGS] COMMAND
Description¶
roq-journal-admin is a database maintenance tool
Create database and tables.
Purge unused request and order history.
Repair the database following a failed purge request.
Flags¶
$ roq-journal-admin --help
--database_uri(http://localhost:8123)Database URI
--database_usernameDatabase username
--database_passwordDatabase password
--database_nameDatabase name
Commands¶
CREATECreate the database (if not exists).
Create the tables (if not exists).
PURGERemove final orders from the
order_ackandorder_updatetables.Retain latest request version from the
order_acktable.Retain latest order version from the
order_updatetable.
Warning
Although attempts are made to deal with errors and roll-backs, this is an error-prone operation due to ClickHouse not supporting transactions. ALWAYS make sure you create a BACKUP before running this command!
REPAIRAttempt to repair the database following a failed
PURGErequest.
Warning
There are edge-cases where it is not possible to repair the database.