Trading Session Gateway quickstart guide

Overview Copied

Use this quickstart to install Trading Session Gateway (TR Gateway) on a Linux or Windows host, connect it to the file streamer, and publish dataviews in Geneos.

The steps are the same for FIX, OUCH, SQF, and DROP. Only the log sources, framing, and dialect settings vary by feed.

For architecture, sizing, operations, dataviews, and message search, see the Trading Session Gateway user guide. For YAML fields and examples, see the configuration reference.

Prerequisites Copied

Before you start, make sure you have:

TR Gateway includes a Java runtime. You do not need to install a system Java. For operating system support, host sizing, and ports, see Prerequisites in the user guide.

These ports are used in the examples:

Port Purpose
9500 Example gRPC ingestion port. Set it per channel with grpc-port. The default is 0, which disables the port.
8080 Status/Search UI (optional). Default for status-server.port.
7035 Example Geneos probe listener port (when Geneos publishing is enabled)
7041 Licence Daemon (default)

Allow inbound traffic on the gRPC port from the file streamer. If you enable Geneos publishing, allow the Geneos Gateway to reach the probe listen port.

Install on a Linux host Copied

  1. Download and extract the Linux bundle (tr-gateway-<package>-<version>-linux-x64.tar.gz), then move the extracted directory to /opt/tr-gateway.

  2. Create a service user and give that user ownership of the installation directory.

  3. Edit /opt/tr-gateway/config/tr-gateway.yaml. Complete the settings in Configure TR Gateway.

  4. Install the packaged systemd unit.

    sudo cp /opt/tr-gateway/service/tr-gateway.service /etc/systemd/system/
    sudo systemctl daemon-reload
    
  5. The shipped template reads host: ${env:TRG_LICD_HOST}, and the unit does not set it. Add the variables in a systemd drop-in with sudo systemctl edit tr-gateway:

    [Service]
    Environment="TRG_LICD_HOST=licd.example.com"
    # Only if protocol-dialects uses these variables. Use the values from your ITRS account manager.
    Environment="TRG_OUCH_DIALECT=<ouch-dialect>"
    Environment="TRG_SQF_DIALECT=<sqf-dialect>"
    Environment="TRG_DROP_DIALECT=<drop-dialect>"
    

    Set only the dialect variables for the families that you keep in protocol-dialects. Replace <ouch-dialect>, <sqf-dialect>, and <drop-dialect> with the values from your ITRS account manager, and omit the angle brackets. Copying a placeholder as written stops TR Gateway at startup.

  6. Enable and start the service.

    sudo systemctl enable tr-gateway
    sudo systemctl start tr-gateway
    

For the complete extract, service-user, and ownership commands, see Install on Linux in the user guide.

Install on a Windows host Copied

  1. Download and extract the Windows bundle. For example:

    Expand-Archive tr-gateway-<package>-*-windows-x64.zip -DestinationPath C:\
    
  2. Edit C:\tr-gateway-<package>-<version>-windows-x64\config\tr-gateway.yaml. Complete the settings in Configure TR Gateway.

  3. Set the environment variables, then start TR Gateway from Command Prompt. The shipped template reads host: ${env:TRG_LICD_HOST}. Set the dialect variables only if protocol-dialects uses them.

    set TRG_LICD_HOST=licd.example.com
    set TRG_OUCH_DIALECT=<ouch-dialect>
    set TRG_SQF_DIALECT=<sqf-dialect>
    set TRG_DROP_DIALECT=<drop-dialect>
    cd /d C:\tr-gateway-<package>-<version>-windows-x64
    bin\tr-gateway.bat config\tr-gateway.yaml
    

    Replace <ouch-dialect>, <sqf-dialect>, and <drop-dialect> with the values from your ITRS account manager, and omit the angle brackets. Copying a placeholder as written stops TR Gateway at startup.

    TR Gateway runs in the foreground. Keep the Command Prompt window open while it is running. Start it from the install directory, because the shipped template uses relative data paths.

  4. Optional: Register the launcher as a Windows service with NSSM, set the same variables with the NSSM AppEnvironmentExtra setting, and set AppDirectory to the install directory. The bundle does not include a native service wrapper, and sc.exe is not suitable for the .bat launcher.

For service registration notes, see Install on Windows in the user guide.

Configure TR Gateway Copied

Edit tr-gateway.yaml before you start, or restart after you change it. Set at least:

Important

Set dialect and CompID prefix values so they match the feed. TR Gateway still starts if they are wrong, but sessions and dataviews can be incorrect. For more information, see Silent-correctness settings.

Keep secrets out of the file. Use ${env:VAR} substitution.

For the full field tables and worked examples, see the configuration reference.

Connect the file streamer Copied

Point the running file streamer at TR Gateway so it can stream records to a channel gRPC port.

  1. Set the gRPC reporter target to the TR Gateway host name or IP address and the channel grpc-port.
  2. Match the framing to the feed. For example, use fix-ascii for FIX text logs. Set payload-encoding on the TR Gateway channel to match what the file streamer sends. The shipped templates use base64.
  3. Set these required producer settings:
    • protocol on each OUCH, SQF, and DROP source: protocol: OUCH, protocol: SQF, or protocol: DROP. The file streamer reads SQF as OUCH and stamps the event with that value. TR Gateway then decodes the records as OUCH, and the stream continues. A value stamped on the event overrides the channel protocol hint.
    • read-from-beginning: true
    • partitioner: direction-session on each OUCH, SQF, and DROP source
    • batch-size equal to logs-batch.size
    • logs-batch.maxRetries: -1
  4. Confirm that the file streamer can reach the gRPC port and that TR Gateway is receiving records.

For the full producer checklist, see File streamer. For configuration details, see File Streamer Collection Agent plugin.

Verify the installation Copied

  1. Confirm that TR Gateway is running. On Linux, run systemctl status tr-gateway. On Windows, check the Command Prompt window if you started TR Gateway in the foreground, or check the registered service.
  2. If the Status UI is enabled, open http://localhost:8080 on the TR Gateway host. The recommended bind-address is 127.0.0.1, so the UI is not reachable from other machines.
  3. Confirm that the file streamer is sending records and that sessions appear in the UI.
  4. If Geneos publishing is enabled, confirm that the Geneos Gateway can reach the probe listen port.

For health checks and start/stop commands, see Install and run TR Gateway in the user guide.

Publish dataviews to Geneos Copied

  1. Check that instrumentation.geneos is enabled in tr-gateway.yaml (the shipped template enables it), and restart TR Gateway after any change.
  2. In Gateway Setup Editor, add a probe that specifies the TR Gateway host and listen port.
  3. Add a managed entity and sampler whose names match the YAML values. Use the API Streams plugin.
  4. Connect Active Console to the Geneos Gateway, and then confirm that dataviews appear under the managed entity.

For probe XML, sampler XML, and TLS notes, see Configure the Gateway Setup Editor in the user guide.

Next steps Copied

After TR Gateway is running and sessions appear:

["Geneos"] ["Geneos > Trading Session Gateway"] ["User Guide"]

Was this topic helpful?