kafka-listeners | Whatever Client Won ’ t Connect to My Apache Kafka Cluster | Pub Sub library
kandi X-RAY | kafka-listeners Summary
kandi X-RAY | kafka-listeners Summary
See My Python/Java/Spring/Go/Whatever Client Won’t Connect to My Apache Kafka Cluster in Docker/AWS/My Brother’s Laptop. Please Help!. Also: Kafka Listeners – Explained.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- doProduce creates a new message and returns the message .
- doConsume is used to create a new consumer
- doAdmin executes the admin client
- This is the main function .
- Converts arguments into a Broker instance .
- String returns a string representation of the broker
kafka-listeners Key Features
kafka-listeners Examples and Code Snippets
Community Discussions
Trending Discussions on kafka-listeners
QUESTION
I'm running Confluent Platform in wsl 2(Ubuntu Distribution) and I also running a Spring application on Windows but when I send a message with a producer I have this error:
Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected
I have a look this articles: https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/ and https://forum.confluent.io/t/running-kafka-connect-sink-on-separate-machine-from-zookeeper-topic-non-localhost/3038 and https://www.confluent.io/blog/kafka-listeners-explained/
But I don't find the solution.
What is the configuration in concluent/etc/kafka/server.properties file?
I've set this:
advertised.listeners=PLAINTEXT://127.0.0.1:9092
listener.security.protocol.map=PLAINTEXT:PLAINTEXT
listeners=PLAINTEXT://0.0.0.0:9092
Kafka is running on: "localhost:9092" and within WSL2 I can send and read messages correctly but it doesn't work my spring boot application on Windows.
I see this answer, but It doesn't work in my localhost: running Kafka on WSL and make producer on windows
Do I have to change something in my Windows configuration? In C:\Windows\System32\drivers\etc\hosts?
Could you please advice how to solve this error? Thanks in advance!
...ANSWER
Answered 2022-Mar-23 at 22:26You need to use ifconfig
(or ip addr
) inside WSL2 terminal, find its external interface IP, then use that as the advertised listener.
Then you'll need to use netsh interface portproxy
command from Windows CMD to forward ports from the hypervisor to the host.
Or you can just use Docker for Windows, run Kafka and configure listeners there, and it'll forward ports correctly on its own
QUESTION
I'm a begginer on kafka as well as docker, I have been doing a course and working with kafka producer and consumer but for some reason it is not working. When I do use of the producer the message are saved in the topic (I have already checked it) but when I try to get the message using the consumer it is not working and I have no idea why.
It had worked previously but not anymore.
The unique difference I have in this case is that I'm using the confluentinc image instead of the bitnami image.
So, if anyone has any idea or solution I would really appreciate it.
I share my compose and an screenshot so you can see it.
...ANSWER
Answered 2022-Mar-01 at 17:30Take a look at docker-compose logs broker
...
You should see a lot of Error processing create topic request CreatableTopic(name='__consumer_offsets', numPartitions=50, replicationFactor=3
Without a valid __consumer_offsets
topic, no consumer will be able to run and commit offsets. Similarly, transactions won't work either (which are enabled by default in latest Kafka)
Add these variables and re-create the containers
QUESTION
Update I'm updating this post to reflect the current configuration (and also, following @OneCricketeer response, more info)
According to this 2018 blog (which everyone seems to refer to) I am running Kafka (in a Docker Compose stack) with this configuration:
...ANSWER
Answered 2021-Dec-21 at 17:15Never modify /etc/hosts
to "fix" your listeners.
Nothing has changed until Kafka completely removes the need for Zookeeper.
lead me to believe that either I'm missing something in the configuration of the container
There are default listeners, but ports
in Docker Compose has nothing to do with the actual broker server configuration. There are not two ports listening for external traffic. Only one for each internal and external.
Note that you are returned kafka0
, as per your advertised setting, which is not the hostname you've set in your compose file, so your internal clients will have errors resolving hostname kafka0
...
seems that Kafka only listens on port 29092 when started like this
It listens on both just fine.
QUESTION
I have set up Zookeeper and Apache Kafka on Docker (Windows) using the following docker-compose.yml
:
ANSWER
Answered 2021-Sep-01 at 10:10Managed to get it working by modifying the docker-compose.yml
specifically kafka's ports
and KAFKA_ADVERTISED_LISTENERS
; and removed KAFKA_LISTENERS
.
QUESTION
This is my docker compose file:
...ANSWER
Answered 2021-Aug-30 at 00:39You've forwarded the wrong port
9093 on the host needs to map to the localhost:9093
advertised port
Otherwise, you're connecting to 9093, which returns kafka:9092
, as explained in the blog. Container hostnames cannot be resolved by the host, by default
QUESTION
I'm trying to get a simple Debezium stack (with Docker Compose) running but the connection to the Kafka broker fails.
Here is my simplified docker-compose.yml
:
ANSWER
Answered 2021-Jul-30 at 18:17You've set a listener to only be local, not external.
Change to
QUESTION
I am starting a container with kafka via docker-compose successfully. By successfully I mean, I can log in such kafka container and produce and consume messages straight from there. Also I can see another container (filebeat) depending on such kafka container connecting successfully.
docker-compose.yml
...ANSWER
Answered 2020-Mar-04 at 15:18KAFKA_ADVERTISED_PORT
is deprecated. Just use the advertised listeners.Your advertised listeners are the Docker service name, not a resolvable address to any code running outside of a container on that same Docker network.
You'll want to add in
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
Just use an existing, functional Docker Compose
Btw, links
is a deprecated Compose option too
QUESTION
My Kafka node is hosted in Google Cloud Dataproc. However, we realized that the Kafka installed through default initialization script is set up in such a way that it only allows intranet access. It is completely isolated from the outside world. The producer outside the google cloud network can't publish the message to Kafka and the Kafka message can't chain to its extranet subscriber.
Remark
I have whitelisted the producer IP
After read thru the other StackOverflow, blog post and documentation. I think it could due to advertised.listeners
parts of Socket Server Settings
in /usr/lib/kafka/server.properties
.
First solution
I added
advertised.listeners=PLAINTEXT://[External_IP]:19092
then
sudo /etc/init.d/kafka-server restart
OUTCOME
However, when I trying to Kafkacat or telnet, it always failed. I also tested advertised.listeners with various port
Second solution from https://rmoff.net/2018/08/02/kafka-listeners-explained/
...ANSWER
Answered 2020-Jan-06 at 23:18Here is what worked for my cluster:
I've set the following properties from the second solution:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install kafka-listeners
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page