Skip to content
Advertisement

Spring Cloud Stream Kafka with Microservices and Docker-Compose Error

I wanted to see if I can connect Spring Cloud Stream Kafka with the help of docker-compose in Docker containers, but I’m stuck and I didn’t find a solution yet, please help me.

I’m working from Spring Microservices In Action; I didn’t find any help by now.

Docker-compose with Kafka and Zookeeper:

JavaScript

Docker-Compose with my Spring services:

JavaScript

App.properties for my services:

JavaScript

Logs from docker containers:

JavaScript

Docker Logs for my services…:

JavaScript

Advertisement

Answer

You need to change back

JavaScript

Then, use same compose file for your Zookeeper, Kafka, and your app to ensure they are in the same network.

Also, the zkNodes addresses should point to Zookeeper container, if you plan on using that property.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement