Dheeraj
Dheeraj

Reputation: 173

Kafka console producer not allowing to write message

I am trying to write some message on topic, but console is not allowing me(producer not waiting for stdin input). I cant see any error log too. Topic is created successfully though. I am using :

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test.

Zookeeper and kafka server are running fine. I am using Mac. What could be the possible issue. I am following Apache Kafka documentation http://kafka.apache.org/documentation.html#quickstart.

Upvotes: 3

Views: 6771

Answers (4)

Anvesh Reddy
Anvesh Reddy

Reputation: 21

Yes it happened to me too because the file is empty, so i copy pasted the consumer.bat file info into producer.bat and rename the ConsoleConsumer with ConsoleProducer and it worked.


@echo off rem Licensed to the Apache Software Foundation (ASF) under one or more rem contributor license agreements. See the NOTICE file distributed with rem this work for additional information regarding copyright ownership. rem The ASF licenses this file to You under the Apache License, Version 2.0 rem (the "License"); you may not use this file except in compliance with rem the License. You may obtain a copy of the License at rem rem http://www.apache.org/licenses/LICENSE-2.0 rem rem Unless required by applicable law or agreed to in writing, software rem distributed under the License is distributed on an "AS IS" BASIS, rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License.

SetLocal set KAFKA_HEAP_OPTS=-Xmx512M "%~dp0kafka-run-class.bat" kafka.tools.ConsoleProducer %* EndLocal

Upvotes: 0

Henry Yang
Henry Yang

Reputation: 61

Ops! the same issue happen to my windows 10, kafka-console-producer.bat file is empty,now i m going to download fresh one to replace existing file.

it works after replacing bat file.

Upvotes: 5

Pratik Satapathy
Pratik Satapathy

Reputation: 51

kafka-console-producer.sh file is empty. I faced the same issue. The solution is to replace kafka-console-producer.sh with a fresh one. This might be an issue that happens only on Mac OS.

Upvotes: 3

sharath
sharath

Reputation: 3616

You dont seem to have kafka running as yet.

sudo jps should return something like this :

10306 SupportedKafka
17788 Jps

saying kafka is running. Check your

log.dirs

config path (server.properties) to see if there is an exception being thrown during kafka start. Also, Kafka recommends use of the latest Java (1.8) : http://kafka.apache.org/documentation.html#java

Upvotes: 0

Related Questions