ngrok

How to leverage ngrok for testing WarpStream Agents running locally.

ngrok is a useful tool to enable services running in the cloud to connect to WarpStream Agents running locally for development purposes.

Install ngrok

Follow the ngrok installation instructions.

Run ngrok locally

Run ngrok tcp 9092

Run the WarpStream Agent

Run the following command:

WARPSTREAM_DISCOVERY_KAFKA_HOSTNAME_OVERRIDE=2.tcp.ngrok.io WARPSTREAM_DISCOVERY_KAFKA_PORT_OVERRIDE=12023 warpstream agent \
    -bucketURL file:///tmp \
    -agentKey aks_XXXXXXXXXX \
    -region us-east-1 \
    -defaultVirtualClusterID vci_XXXXXXXXXX

Note that the values of WARPSTREAM_DISCOVERY_KAFKA_HOSTNAME_OVERRIDE and WARPSTREAM_DISCOVERY_KAFKA_PORT_OVERRIDE need to match the address and port from the "Forwarding" section of the previous step.

Confirm Connectivity

Run the following command:

warpstream cli diagnose-connection -bootstrap-host 2.tcp.ngrok.io -bootstrap-port 12023

Note that the value of -bootstrap-host and -bootstrap-port must match the values from the "Forwarding" section of the "Run ngrok locally" step.

If everything is working correctly, you should see output like this:

running diagnose-connection sub-command with bootstrap-host: 8.tcp.ngrok.io and bootstrap-port: 13067


Broker Details
---------------
  2.tcp.ngrok.io:12023 (NodeID: 1492894352) [warpstream-unset-az]
    ACCESSIBLE ✅


GroupCoordinator: 2.tcp.ngrok.io:12023 (NodeID: 1492894352)
    ACCESSIBLE ✅

Last updated

Was this helpful?