kafka producer config

Read about kafka producer config, The latest news, videos, and discussion topics about kafka producer config from alibabacloud.com

Kafka Producer Consumer API interface

Producer}public static void Main (string[] args) {New Kafkaproducer ("Test"). Start ();}}ConsumerImport Java.util.HashMap;Import java.util.List;Import Java.util.Map;Import java.util.Properties;Import Kafka.consumer.Consumer;Import Kafka.consumer.ConsumerConfig;Import Kafka.consumer.ConsumerIterator;Import Kafka.consumer.KafkaStream;Import Kafka.javaapi.consumer.ConsumerConnector;public class Kafkacomsumer extends Thread {Private String topic;Public K

Kafka Getting Started 1-cluster production message: ERROR Producer connection to localhost:9092 unsuccessful

./kafka-console-producer.sh--broker-list localhost:9092--topic topic1, report the following error [2014-12-02 14:16:21,565] ERROR Producer Connection to localhost:9092 unsuccessful (kafka.producer.SyncProducer)Java.net.ConnectException:Connection refusedAt Sun.nio.ch.Net.connect0 (Native Method)At Sun.nio.ch.Net.connect (net.java:465)At Sun.nio.ch.Net.connect (net.java:457)At Sun.nio.ch.SocketChannelImpl.co

Kafka producer Java Code

public class Kafkaproducerdemo {public static void main (string[] args) throws Interruptedexception {/* Properties props = New Properties (); * Props.put ("Bootstrap.servers", "localhost:9092"); * Props.put ("ACKs", "all"); * Props.put ("retries", 0); * Props.put ("batch.size", 16384); * Props.put ("linger.ms", 1); * Props.put ("buffer.memory", 33554432); * Props.put ("Key.serializer", "Org.apache.kafka.common.serialization.StringSerializer"); * Props.put ("Value.serializer", "Org.apache.kafka.c

Total Pages: 2 1 2 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.