nats-io / nats-kafka

NATS to Kafka Bridging
Apache License 2.0
131 stars 32 forks source link

Unable to connect to STAN #32

Open anshulsri12 opened 3 years ago

anshulsri12 commented 3 years ago

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.

narslan commented 3 years ago

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.

variadico commented 3 years ago

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.