---
title: "Trading Session Gateway quickstart guide"
description: "Install TR Gateway on Linux or Windows, connect it to the file streamer, and publish trading-session dataviews to Geneos."
url: "https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-quickstart/index.html"
---
## Overview

Use this quickstart to install Trading Session Gateway (TR Gateway) on a Linux or Windows host, connect it to the [file streamer](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html). For YAML fields and examples, see the [configuration reference](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html).

## Prerequisites

Before you start, make sure you have:

- A TR Gateway installation bundle for Linux or Windows from [ITRS Downloads](https://resources.itrsgroup.com/downloads). Replace `<package>` in the paths below with the package name that ITRS supplies for your feeds. See [Choose the package](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#choose-the-package).
- The [file streamer](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#file-streamer) already installed and configured to tail your trading logs. It is the [File Streamer Collection Agent plugin](https://docs.itrsgroup.com/docs/geneos/collection/file-streamer/current/user-guide/file-streamer/index.html), and it must include the gRPC reporter. TR Gateway receives those records over gRPC. This quickstart uses the file streamer. The top-level `data-dir` lane is separate. On that lane, TR Gateway ingests and tails log files itself, without the file streamer, for example on an offline instance. See [Ingestion lanes](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#ingestion-lanes).
- A Licence Daemon with grants for the protocol families you want to monitor.
- A Geneos Gateway and Active Console, if you want dataviews in Geneos.

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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#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

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](#configure-tr-gateway).
4. Install the packaged systemd unit.

   ```bash
   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`:

   ```text
   [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.

   ```bash
   sudo systemctl enable tr-gateway
   sudo systemctl start tr-gateway
   ```

For the complete extract, service-user, and ownership commands, see [Install on Linux](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#install-on-linux) in the user guide.

## Install on a Windows host

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

   ```powershell
   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](#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.

   ```bat
   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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#install-on-windows) in the user guide.

## Configure TR Gateway

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

- [Licensing](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#licensing) — Licence Daemon host and port.
- [Channels](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#channels) — `type: streaming`, an optional `protocol` hint, gRPC port, payload encoding, journal directory, and default session IDs for protocols that do not identify a session on the wire.
- [Protocol dialects](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#protocol-dialects) — required for every non-FIX family you stream. The shipped `tr-gateway.yaml` lists the values for the families it is built for, so keep them. For the `all` package, ask your ITRS account manager which template and values to use. If you use the `${env:...}` variables instead, set them as the install steps describe. The dialects you can use depend on your package and license. Contact your ITRS account manager for the values.
- [Local CompID prefixes](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#local-compid-prefixes) — recommended for FIX direction.
- [Geneos instrumentation](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#geneos-instrumentation) — probe name, managed entity, sampler name, and listen port. These names must match the Geneos Gateway setup. The shipped template already enables Geneos publishing.
- [Search](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#search) and [search commands](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#search-commands) — retained trade-message lookup, which requires extra host memory. The shipped template already turns on search and search commands, so a stock installation has them. Remove them if you do not want them.
- Optional [Status server](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#status-server) — browser UI on port `8080` by default. Set `bind-address: 127.0.0.1`, because the UI has no authentication or TLS.
- Optional [Schedules](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#schedules) — operational hours and holiday calendars. Every operational schedule needs a `timezone`.


**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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html#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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html).

## Connect the file streamer

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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#file-streamer). For configuration details, see [File Streamer Collection Agent plugin](https://docs.itrsgroup.com/docs/geneos/collection/file-streamer/current/user-guide/file-streamer/index.html).

## Verify the installation

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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#install-and-run-tr-gateway) in the user guide.

## Publish dataviews to Geneos

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](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#configure-the-gateway-setup-editor) in the user guide.

## Next steps

After TR Gateway is running and sessions appear:

- Review [published dataviews](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#published-dataviews) and add rules in Geneos.
- Use [message search](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#search-messages) to look up retained trade messages. The search commands appear in Active Console on their own once `search-commands.enabled` is true.
- Use the [Status UI](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#status-ui) for live diagnostics.
- Tune heap, journals, and retention for your session count. See [Prerequisites](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#prerequisites) and [Configure JVM options](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway/index.html#configure-jvm-options) in the user guide.
- Use the [configuration reference](https://docs.itrsgroup.com/docs/geneos/collection/tr-gateway/1.0.0/user-guide/tr-gateway-config-ref/index.html) when you add protocols, schedules, or TLS.


