Producer作为kafak核心组件之一,学习和分析它是很有必要的。producer配置文件在kafak的config目录下,配置好它
在以后的学习和工作中都可以起到事半功倍的效果。
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# see kafka.producer.ProducerConfig for more details
############################# Producer Basics #############################
# list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
#指定节点列表(必填,集群需要写各个节点,我这里是单机)
# name of the partitioner class for partitioning events; default partition spreads data randomly
#指定分区处理类。默认kafka.producer.DefaultPartitioner
partitioner.class=kafka.producer.DefaultPartitioner
# specifies whether the messages are sent asynchronously (async) or synchronously (sync)
#sync同步(默认),async异步可以提高发送吞吐量
# specify the compression codec for all data generated: none, gzip, snappy, lz4.
# the old config values work as well: 0, 1, 2, 3 for none, gzip, snappy, lz4, respectively
#是否压缩,0代表不压缩,1代表用gzip压缩,2代表用snappy压缩