nats-kafka icon indicating copy to clipboard operation
nats-kafka copied to clipboard

Unable to connect to STAN

Open anshulsri12 opened this issue 4 years ago • 2 comments

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.

anshulsri12 avatar Apr 08 '21 06:04 anshulsri12

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.

narslan avatar May 01 '21 19:05 narslan

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.

variadico avatar Jul 29 '21 00:07 variadico