Skip to content

RT Bridge

Beta Feature

This feature is in beta and subject to change.

Introduction

The RT Bridge is a q process, that can be installed outside the KX Insights Platform to enable existing applications that deliver data to a q process (typically a tickerplant), to deliver the same data to the KX Insights Platform without modification.

The RT Bridge is a q process that provides an update function, just like the update function in a tickerplant, to publish data to the KX Insights Platform.

Downloading

If you would like to try the RT Bridge please contact KX Support. It will be available soon from the KX Insights Nexus registry.

The following artifacts will be available:

  • rt-bridge-${VERSION}.install.sh
  • rt-bridge-${VERSION}.deb
  • rt-bridge-${VERSION}-rhel.x86_64.rpm

Installing

From a command terminal run

sudo apt install ./rt-bridge-${VERSION}.deb

From a command terminal run

sudo yum install rt-bridge-${VERSION}-rhel.x86_64.rpm

From a command terminal run

./rt-bridge-${VERSION}-install.sh

Uninstalling

From a command terminal run

sudo apt remove rt-bridge

From a command terminal run

sud rpm -U rt-bridge-${VERSION}-rhel.x86_64.rpm

From a command terminal run

sud rpm -U rt-bridge-${VERSION}-uninstall.sh

Running the RT Bridge

Before running the RT Bridge you will need to follow the instructions here to allow the RT bridge to send data to the KX Insights Platform.

The following arguments are available when running the RT Bridge:

argument required default description
-dir Mandatory none The storage directory for local stream log files and state files.
-configurl Mandatory none The URL to the Information Service endpoint.
-timeout Optional 5000 The number of milliseconds after which the RT Bridge exits if cannot connect to the Information Service.
-port Optional 5000 The port to be opened to receive qIPC messages from the calling application.
-upd Optional "upd" The name of the function publishers should call through qIPC to publish messages.

configurl format

The URL is in the format: (https://{INSIGHTS_HOSTNAME}/informationservice/details/{KC_CONFIG_URL})

For example: The following command shows how to run the RT Bridge to send data to a Stream in the KX Insights Platform defined by the KC_CONFIG_URL and storing the messages locally in the /s/out folder:

rt-bridge -dir /s/out -configurl https://{INSIGHTS_HOSTNAME}/informationservice/details/{KC_CONFIG_URL}

Note

When called without commandline arguments, this brief instruction is printed:

rt-bridge

usage: rt-bridge -dir /s/out [-timeout 5000] [-port 5000] [-upd upd] -configurl url

RT Bridge Readiness

After starting the RT Bridge it prints the below message when it is ready to receive messages and has opened a qIPC port to which you can send data:

$ rt-bridge -dir /tmp/rt-demo -configurl $URL

; saving ssl files
; setting cookie and enabling networking...
; setup complete
; starting replication to...
; publishing insert to...
; publishing query to...
; update function: upd
; rt-bridge is open on port 5000

Publishing data

We can now publish data to the RT Bridge, which will deliver the data to the KX Insights Platform.

The sample below publishes a set of messages called data to a table called email. It does this via the upd function:

// open a tcp/ip socket connection to the RT bridge
h:hopen 5000

// send data synchronously to the RT bridge
h(`upd; `email; data);

// alternatively, send data asynchronously to the RT bridge
neg[h](`upd; `email; data);

Points of note

The bridge defaults to running on port 5000. The default function used to feed into the KX Insights Platform is called upd.

Clean Shutdown

It is important to shut down the RT Bridge properly to avoid potential data loss (eg. due to local disk failures) or unnecessary delays.

On normal exit (for example \ or exit 0) the .z.exit handle flushes the message buffer to make sure every message is replicated on the remote servers.

Killing the process

When the process is killed (for example using kill -9) some messages may remain in the buffer and are only delivered after restarting the RT Bridge with the same parameters.