nats-kafka
nats-kafka copied to clipboard
Unable to connect to STAN
Getting error, stan: connect request timeout (possibly wrong cluster ID?) while connecting to STAN.
However, clusterID is correct as verified separately by enqueing and dequeing messages with the same clustedID configuration using python NATS library.
I had the same problem. I found that ClusterID (per document) field of stan should be all lower cased, as clusterid.
That part is incorrectly documented.
Is this still an issue? I wasn't able to reproduce.
This is the config file I used for nats-kafka.
nats: {
Servers: ["localhost:4222"],
}
stan: {
ClusterID: "foo-cluster",
ClientID: "kafkabridge",
connectwait: 1000,
}
connect: [
{
type: "STANToKafka",
brokers: ["localhost:9092"]
id: "foo",
topic: "bar",
channel: "baz",
},
{
type: "KafkaToStan",
brokers: ["localhost:9092"]
id: "whizz",
topic: "bar",
channel: "bang",
},
]
I started a Kafka instance with make setup-docker-test.
Next, I started a NATS Streaming server with this command.
./nats-streaming-server -DVV -cid foo-cluster
Finally, I started nats-kafka like this.
./nats-kafka -c nats-kafka.conf
I was able to start nats-kafka without any errors.