Skip to content

Connect your apps

The cluster's names and ports, TLS with the EZGH CA bundle, the plaintext port, and the Kafka client versions it takes.

Updated View as Markdown
ezgh hosted-queues clusters get hqc_4k2m9x0a7qpe

The console shows the same on the cluster’s Connectivity tab: its names, ports and the CA bundle, and each user’s Secret on the Users tab.

Connect from an address in the cluster’s allowed sources, inside its VPC. Use the names, never addresses: they stay the same for the cluster’s life.

Names and ports

RabbitMQ has one name for the whole cluster, such as mq-hylq6kelvuwvn2ks4yqhp4jaqu.us-west-1.ezghcompute.com, on port 5671 (AMQPS). A client can connect through it to any node, and reaches every queue from there.

Kafka has a bootstrap name, such as kafka-hylq6kelvuwvn2ks4yqhp4jaqu.us-west-1.ezghcompute.com, on port 9093 (SASL_SSL). Give clients the bootstrap name as their bootstrap servers; each broker then gives its own name, b0-kafka-…, b1-kafka-… and b2-kafka-…, which clients connect to as well. endpoint.brokers lists them.

Each user’s Secret holds the host, port, username and password, and on Kafka bootstrapServers, on RabbitMQ a ready-made amqps:// URI.

TLS

The cluster’s certificates are for its names and chain to the EZGH CA bundle. Verify the server’s certificate and its name against the bundle:

curl -fsSO https://get.ezghcloud.com/hosted-queues/ca-bundle.pem

librdkafka is the client under Python’s confluent-kafka, Go’s confluent-kafka-go, .NET’s Confluent.Kafka and Node’s @confluentinc/kafka-javascript.

bootstrap.servers=kafka-hylq6kelvuwvn2ks4yqhp4jaqu.us-west-1.ezghcompute.com:9093
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
sasl.username=app
sasl.password=<password>
ssl.ca.location=ca-bundle.pem
bootstrap.servers=kafka-hylq6kelvuwvn2ks4yqhp4jaqu.us-west-1.ezghcompute.com:9093
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="app" password="<password>";
ssl.truststore.type=PEM
ssl.truststore.location=ca-bundle.pem
import ssl
import pika

context = ssl.create_default_context(cafile="ca-bundle.pem")
params = pika.URLParameters(uri)  # the user's Secret's uri field
params.ssl_options = pika.SSLOptions(context, "mq-hylq6kelvuwvn2ks4yqhp4jaqu.us-west-1.ezghcompute.com")
connection = pika.BlockingConnection(params)
import { readFileSync } from "node:fs";
import amqp from "amqplib";

const connection = await amqp.connect(uri, { ca: [readFileSync("ca-bundle.pem")] });

An AMQP URI names its vhost after the port. The default vhost, /, is written %2F: amqps://app:<password>@mq-….us-west-1.ezghcompute.com:5671/%2F.

The plaintext port

For apps that can’t use TLS, a cluster can also serve its client protocol without TLS, inside the VPC, still with a username and password: port 9092 (SASL_PLAINTEXT) on Kafka and 5672 (AMQP) on RabbitMQ. Turn it on or off with plaintextPort:

ezgh hosted-queues clusters update hqc_4k2m9x0a7qpe --plaintext-port=true --wait

The Secret’s plaintextPort field holds the port while it’s on.

Unauthenticated access

For apps that support TLS but not SASL, such as PostHog’s Rust services, a Kafka cluster can also serve port 9091 over TLS with no username or password. It’s off by default. Turn it on with the access it gives, readWrite (produce, consume and create topics) or readOnly (consume):

ezgh hosted-queues clusters update hqc_4k2m9x0a7qpe --unauthenticated-access readWrite --wait

Only the cluster’s allowed sources and firewall peers reach the port, and endpoint.unauthenticatedPort shows it while it’s on. Turning it on or off restarts the brokers one at a time; clients reconnect. --unauthenticated-access off turns it off. RabbitMQ clusters don’t have it.

Client versions

Kafka clients need version 2.1 or later of the Kafka protocol; older clients are refused. Current librdkafka, the Java client and franz-go all qualify. Any AMQP 0-9-1 client works with RabbitMQ.

DNS

The names are DNS names for private addresses in your VPC, with a 5-second TTL. Instances resolve them through public DNS, so an app’s instance needs a path to the internet to look them up, for example through a Network Gateway or a public IPv4 address. The connection itself stays inside the VPC. See Timeouts and reconnects for DNS caching in clients.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close