Support Questions

Find answers, ask questions, and share your expertise

Produce Message in Kafka running in HDF 3.0.2 using Java Program


I have created "my-topic" in kafka and trying to produce message using Java program running on my local machine, outside of the HDF 3.0.2.

Kafka broker is running on port 6667 and the IP address of VMware box is

In my java program, bootstrap server config is as shown below.

Please let me know if any I am missing anything to produce message in kafka in HDF3.0.2 from a local machine.

Thanks much.

props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "");

Super Mentor

@Hiren Dossani

The code snippet looks good. What error or exception are you facing while executing the code?

If you are running the code on your local machine and trying to connect to the kafka broker on VMWare Box then please make sure that you are able to establish connection from your local box first like:

# telnet 6667


If not then please check if the Firewall is disabled or not? and if required check the port forwarding to see if you are allowed to access that port from your local machine.

Thanks Jay for your reply. I disabled the firewall on my mac, yet no luck. No, I am not able to connect using telnet 6667

So far, I updated /etc/hosts file as and updated java code to use in bootstrap server config but no success.

Although, I am able to list the topics using terminal window with below command:

bin/ --list --zookeeper

Interchanging to in java program doesn't help either.

Super Mentor

I have the HDF_3.0.2 running on VmWare.

Cannot even ssh into Vmware box using command ssh -p 2122

Is there any simple example/steps to follow ? Thanks for your help and earliest attention.

I want to demo integrating jenkins with java and produce messages in Kafka in HDF using java from my local machine, outside of VmWare.

Thanks for your earliest help and attention.

Super Mentor

@Hiren Dossani

You are not able to do ssh into Vmware box using command because the port seems to be wrong for HDF ssh -p 2122


For Doing SSH to HDF you will need to use a slightly different port. To login to the VM you will need to use 12122 port

# ssh root@ -p 12122
Enter Password: hadoop


In order to login to the Docker Container where the HDF components are actually running you will need to use:

# ssh root@ -p 12222
Enter Password: hadoop