Gateway Quickstart¶
This guide starts a Gateway on a running 3forge instance and makes a first connection over each of its 2 listeners. The steps edit files under the installation root and run commands from the admin console; the console commands in this guide are entered at a live admin console prompt.
Prerequisites¶
- A running 3forge Enterprise instance with at least one Center reachable.
- Write access to the installation's
data/directory. - For the JDBC step, the JDBC driver available to the client, and a client certificate authorized for the JDBC listener. See JDBC Access.
Steps¶
-
Add a Gateway component. Add this line to
data/ami.components:The line is
name;type;pwd: an arbitrary unique name, the component typeGATEWAY, and.for the process default working directory. The file is watched, so the Gateway launches without a restart. -
Confirm the routes file. On first start the Gateway creates
data/gateway.routesif it is absent, containing one example route to the local Center:Edit this file to point at the Centers the Gateway should reach. See Routing for the format and reload behavior.
-
Connect over the JDBC listener. Using the JDBC driver, connect to the JDBC port (default
3407). Because the shipped Gateway configures a keystore, the connection uses mutual TLS, so supply the TLS options and a client certificate:Run a
SELECTand confirm rows come back. A plain URL without the TLS options is refused on a default Gateway. See JDBC Access for the driver, the full option list, and the read-only and AMI-expressionWHERErestrictions. -
Connect over the native listener. The native port speaks the same subscribe and query protocol a Center serves, so the Python and C++ client libraries reach it by pointing their subscription configuration at the Gateway instead of a Center:
A Gateway requires a username and password on that connection, where a Center reached directly can admit a client on its certificate alone. Set the TLS options on the shard as for any client (see Server pinning and TLS settings), and pass the username and password to the subscription configuration. Wait for the login to be accepted, which
on_logged_insignals, before subscribing: a subscription sent earlier delivers nothing. See Credentials.For live data in a browser rather than a program, use the Web subscription path in Streaming. To run the route-management commands referenced above, see reaching the admin console in Routing.
Result¶
The Gateway runs as a component in the instance, its routes file points at the Centers it fronts, and a client can connect over both the native and JDBC listeners. From here: