0

I am very new to Kafka. Following a few tutorials, I have the following questions regarding consuming actual Kafka topics.

The situation: there is a server in my workplace that is streaming Kafka topics. I have the topic name. I would like to consume this topic from my machine (Windows WSL2 Ubuntu). From this tutorial, I am able to

  • Run zookeeper with this command:
bin/zookeeper-server-start.sh config/zookeeper.properties
  • Create a broker with:
bin/kafka-server-start.sh config/server.properties
  • Run a producer console, with a fake topic named quickstart-events at port localhost:9092:
bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092 
  • Run a consumer console listening to localhost:9092 and receive the streaming data from the producer:
bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092

Now for my real situation: if I know the topic name, what else do I need in order to apply the same steps above to listen to it as a consumer? What are the steps involved? I read in other threads about tunnelling with Jumphost. How to do that?

I understand this question is rather generic. Appreciate any pointers to any relevant readings or guidance.

Tristan Tran
  • 1,351
  • 1
  • 10
  • 36

1 Answers1

1

Based on your company nameserver the next procedure should be done in your wsl instance To gain outside connection

unable to access network from WSL2

You need to set bootstrap-server to your company server

--bootstrap-server my.company.com:9092

Ran Lupovich
  • 1,655
  • 1
  • 6
  • 13
  • So I can use the same command for ```console-consumer```. But I need to replace the localhost:9092 with my company IP address and port, xx.xx.xx.xx : xxxx. Thanks for advising. I will try this. – Tristan Tran Jun 03 '21 at 20:48
  • 2
    Basically yes, you need access from your wsl to the company server , I suggest to use fqdn and not ip – Ran Lupovich Jun 03 '21 at 20:50
  • 1
    I got the full domain name from IT and it works ! – Tristan Tran Jun 03 '21 at 22:33