I'm creating an app that shows real-time data coming from IIoT.
My whole app is in docker containers with Kafka and Zookeeper running without a problem, I execute node-red (in my local machine) and it connected successfully but when I tried to produce messages from IIoT in node-red it gives "Connection down started queuing messages".
This is my docker-compose.yml (for Kafka and Zookeeper):
zookeeper:
image: confluentinc/cp-zookeeper:latest
ports:
- 2181:2181
environment:
- ZOOKEEPER_CLIENT_PORT=2181
volumes:
- zookeeper_data:/var/lib/zookeeper
networks:
- app_backend_network
kafka:
image: confluentinc/cp-kafka:latest
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_LISTENERS=LISTENER_BOB://kafka:9092,LISTENER_FRED://127.0.0.1:29092
- KAFKA_ADVERTISED_LISTENERS=LISTENER_BOB://kafka:9092,LISTENER_FRED://127.0.0.1:29092
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=LISTENER_BOB:PLAINTEXT,LISTENER_FRED:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME=LISTENER_BOB
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_AUTO_CREATE_TOPICS_ENABLE=false
ports:
- 9092:9092
- 29092:29092
depends_on:
- zookeeper
volumes:
- kafka_data:/var/lib/kafka
networks:
- app_backend_network
Host : 127.0.0.1:29092
Host : 127.0.0.1:9092
I tried to connect "TH" directly to messages and I received messages with no errors the problem here is probably connecting to the broker.
I forgot to mention that when I set up Kafka in my local machine without docker it worked just fine.
Any help, please!