Connection to Kafka throws 504 error


I am very new to Druid and Kafka. I have set up Druid and Kafka in the same server and could able to load data to druid from Kafka according to the tutorial

Anyhow, we want Kafka and Druid to run in separate systems. Now when I try to connect to Kafka (which is set up in another server) from my Druid server I am getting Error 504.

I have given bootstrap server as IPaddressofKafkaserver:9092 and topic-name.
The topic is just a 3 line test message which we want to load in Druid.

I am using the latest version of Kafka (Docker Image) and Druid.

Please guide me whether we need to do any additional settings/configurations and we do not find many materials online in this regard.

Have you verified that the ports are open and you can see each server from the other?

Yes Ports are already opened. The issue resolved. In kafka docker compose file extended hostname is given as IP address of the kafka server. So druid could call the bootstrap server using IP address.