Browse Source

MINOR: remove old producer in config sections to align with APIs

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Gwen Shapira

Closes #468 from guozhangwang/WikiUpdate
pull/468/merge
Guozhang Wang 9 years ago committed by Gwen Shapira
parent
commit
a87b978223
  1. 158
      docs/configuration.html
  2. 7
      docs/documentation.html

158
docs/configuration.html

@ -32,7 +32,7 @@ Topic-level configurations and defaults are discussed in more detail <a href="#t
<p>More details about broker configuration can be found in the scala class <code>kafka.server.KafkaConfig</code>.</p> <p>More details about broker configuration can be found in the scala class <code>kafka.server.KafkaConfig</code>.</p>
<p><a id="topic-config">Topic-level configuration</a></h3> <a id="topic-config">Topic-level configuration</a>
Configurations pertinent to topics have both a global default as well an optional per-topic override. If no per-topic configuration is given the global default is used. The override can be set at topic creation time by giving one or more <code>--config</code> options. This example creates a topic named <i>my-topic</i> with a custom max message size and flush rate: Configurations pertinent to topics have both a global default as well an optional per-topic override. If no per-topic configuration is given the global default is used. The override can be set at topic creation time by giving one or more <code>--config</code> options. This example creates a topic named <i>my-topic</i> with a custom max message size and flush rate:
<pre> <pre>
@ -106,7 +106,7 @@ The following are the topic-level configurations. The server's default configura
<td>min.insync.replicas</td> <td>min.insync.replicas</td>
<td>1</td> <td>1</td>
<td>min.insync.replicas</td> <td>min.insync.replicas</td>
<td>When a producer sets request.required.acks to -1, min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend). </br> <td>When a producer sets request.required.acks to -1, min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).
When used together, min.insync.replicas and request.required.acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with request.required.acks of -1. This will ensure that the producer raises an exception if a majority of replicas do not receive a write.</td> When used together, min.insync.replicas and request.required.acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with request.required.acks of -1. This will ensure that the producer raises an exception if a majority of replicas do not receive a write.</td>
</tr> </tr>
<tr> <tr>
@ -147,7 +147,17 @@ The following are the topic-level configurations. The server's default configura
</tr> </tr>
</table> </table>
<h3><a id="consumerconfigs">3.2 Consumer Configs</a></h3> <h3><a id="producerconfigs">3.2 Producer Configs</a></h3>
Below is the configuration of the Java producer:
<!--#include virtual="producer_config.html" -->
<p>
For those interested in the legacy Scala producer configs, information can be found <a href="http://kafka.apache.org/082/documentation.html#producerconfigs">
here</a>.
</p>
<h3><a id="consumerconfigs">3.3 Consumer Configs</a></h3>
The essential consumer configurations are the following: The essential consumer configurations are the following:
<ul> <ul>
<li><code>group.id</code> <li><code>group.id</code>
@ -317,142 +327,6 @@ The essential consumer configurations are the following:
<p>More details about consumer configuration can be found in the scala class <code>kafka.consumer.ConsumerConfig</code>.</p> <p>More details about consumer configuration can be found in the scala class <code>kafka.consumer.ConsumerConfig</code>.</p>
<h3><a id="newconsumerconfigs">3.3 New Consumer Configs</a></h3> <h3><a id="newconsumerconfigs">3.4 New Consumer Configs</a></h3>
Since 0.9.0.0 we have been working on a replacement for our existing simple and high-level consumers. The code can be considered beta quality. Below is the configuration for the new consumer: </p> Since 0.9.0.0 we have been working on a replacement for our existing simple and high-level consumers. The code can be considered beta quality. Below is the configuration for the new consumer:
<!--#include virtual="consumer_config.html" --> <!--#include virtual="consumer_config.html" -->
<h3><a id="producerconfigs">3.4 Kafka Producer Configs</a></h3>
We recommend using KafkaProducer as SyncProducer and AsyncProducer will be deprecated in the next release. Below is the configuration for the new producer:</p>
<!--#include virtual="producer_config.html" -->
<h3><a id="oldproducerconfigs">3.5 Old Producer Configs</a></h3>
We recommend not to use the Scala SyncProducer and AsyncProducer as they will be deprecated in the next release. Below you can see their configuration:
<ul>
<li><code>metadata.broker.list</code>
<li><code>request.required.acks</code>
<li><code>producer.type</code>
<li><code>serializer.class</code>
</ul>
<table class="data-table">
<tbody><tr>
<th>Property</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>metadata.broker.list</td>
<td colspan="1"></td>
<td>
<p>This is for bootstrapping and the producer will only use it for getting metadata (topics, partitions and replicas). The socket connections for sending the actual data will be established based on the broker information returned in the metadata. The format is host1:port1,host2:port2, and the list can be a subset of brokers or a VIP pointing to a subset of brokers.</p>
</td>
</tr>
<tr>
<td>request.required.acks</td>
<td colspan="1">0</td>
<td>
<p>This value controls when a produce request is considered completed. Specifically, how many other brokers must have committed the data to their log and acknowledged this to the leader? Typical values are
<ul>
<li>0, which means that the producer never waits for an acknowledgement from the broker (the same behavior as 0.7). This option provides the lowest latency but the weakest durability guarantees (some data will be lost when a server fails).
<li> 1, which means that the producer gets an acknowledgement after the leader replica has received the data. This option provides better durability as the client waits until the server acknowledges the request as successful (only messages that were written to the now-dead leader but not yet replicated will be lost).
<li> -1, The producer gets an acknowledgement after all in-sync replicas have received the data. This option provides the greatest level of durability. However, it does not completely eliminate the risk of message loss because the number of in sync replicas may, in rare cases, shrink to 1. If you want to ensure that some minimum number of replicas (typically a majority) receive a write, then you must set the topic-level min.insync.replicas setting. Please read the Replication section of the design documentation for a more in-depth discussion.
</ul>
</p>
</td>
</tr>
<tr>
<td>request.timeout.ms</td>
<td colspan="1">10000</td>
<td>The amount of time the broker will wait trying to meet the request.required.acks requirement before sending back an error to the client.</td>
</tr>
<tr>
<td>producer.type</td>
<td colspan="1">sync</td>
<td>
<p>This parameter specifies whether the messages are sent asynchronously in a background thread. Valid values are (1) async for asynchronous send and (2) sync for synchronous send. By setting the producer to async we allow batching together of requests (which is great for throughput) but open the possibility of a failure of the client machine dropping unsent data.</p>
</td>
<tr>
<td>serializer.class</td>
<td colspan="1">kafka.serializer.DefaultEncoder</td>
<td>The serializer class for messages. The default encoder takes a byte[] and returns the same byte[].</td>
</tr>
<tr>
<td>key.serializer.class</td>
<td colspan="1"></td>
<td>The serializer class for keys (defaults to the same as for messages if nothing is given).</td>
</tr>
<tr>
<td>partitioner.class</td>
<td colspan="1">kafka.producer.DefaultPartitioner</td>
<td>The partitioner class for partitioning messages amongst sub-topics. The default partitioner is based on the hash of the key.</td>
</tr>
<tr>
<td>compression.codec</td>
<td colspan="1">none</td>
<td>
<p>This parameter allows you to specify the compression codec for all data generated by this producer. Valid values are "none", "gzip" and "snappy".</p>
</td>
</tr>
<tr>
<td>compressed.topics</td>
<td colspan="1">null</td>
<td>
<p>This parameter allows you to set whether compression should be turned on for particular topics. If the compression codec is anything other than NoCompressionCodec, enable compression only for specified topics if any. If the list of compressed topics is empty, then enable the specified compression codec for all topics. If the compression codec is NoCompressionCodec, compression is disabled for all topics</p>
</td>
</tr>
<tr>
<td>message.send.max.retries</td>
<td colspan="1">3</td>
<td>
<p>This property will cause the producer to automatically retry a failed send request. This property specifies the number of retries when such failures occur. Note that setting a non-zero value here can lead to duplicates in the case of network errors that cause a message to be sent but the acknowledgement to be lost.</p>
</td>
</tr>
<tr>
<td>retry.backoff.ms</td>
<td colspan="1">100</td>
<td>
<p>Before each retry, the producer refreshes the metadata of relevant topics to see if a new leader has been elected. Since leader election takes a bit of time, this property specifies the amount of time that the producer waits before refreshing the metadata.</p>
</td>
</tr>
<tr>
<td>topic.metadata.refresh.interval.ms</td>
<td colspan="1">600 * 1000</td>
<td>
<p>The producer generally refreshes the topic metadata from brokers when there is a failure (partition missing, leader not available...). It will also poll regularly (default: every 10min so 600000ms). If you set this to a negative value, metadata will only get refreshed on failure. If you set this to zero, the metadata will get refreshed after each message sent (not recommended). Important note: the refresh happen only AFTER the message is sent, so if the producer never sends a message the metadata is never refreshed</p>
</td>
</tr>
<tr>
<td>queue.buffering.max.ms</td>
<td colspan="1">5000</td>
<td>Maximum time to buffer data when using async mode. For example a setting of 100 will try to batch together 100ms of messages to send at once. This will improve throughput but adds message delivery latency due to the buffering.</td>
</tr>
<tr>
<td>queue.buffering.max.messages</td>
<td colspan="1">10000</td>
<td>The maximum number of unsent messages that can be queued up the producer when using async mode before either the producer must be blocked or data must be dropped.</td>
</tr>
<tr>
<td>queue.enqueue.timeout.ms</td>
<td colspan="1">-1</td>
<td>
<p>The amount of time to block before dropping messages when running in async mode and the buffer has reached queue.buffering.max.messages. If set to 0 events will be enqueued immediately or dropped if the queue is full (the producer send call will never block). If set to -1 the producer will block indefinitely and never willingly drop a send.</p>
</td>
</tr>
<tr>
<td>batch.num.messages</td>
<td colspan="1">200</td>
<td>The number of messages to send in one batch when using async mode. The producer will wait until either this number of messages are ready to send or queue.buffer.max.ms is reached.</td>
</tr>
<tr>
<td>send.buffer.bytes</td>
<td colspan="1">100 * 1024</td>
<td>Socket write buffer size</td>
</tr>
<tr>
<td>client.id</td>
<td colspan="1">""</td>
<td>The client id is a user-specified string sent in each request to help trace calls. It should logically identify the application making the request.</td>
</tr>
</tbody></table>
<p>More details about producer configuration can be found in the scala class <code>kafka.producer.ProducerConfig</code>.</p>

7
docs/documentation.html

@ -40,10 +40,9 @@ Prior releases: <a href="/07/documentation.html">0.7.x</a>, <a href="/08/documen
<li><a href="#configuration">3. Configuration</a> <li><a href="#configuration">3. Configuration</a>
<ul> <ul>
<li><a href="#brokerconfigs">3.1 Broker Configs</a> <li><a href="#brokerconfigs">3.1 Broker Configs</a>
<li><a href="#consumerconfigs">3.2 Consumer Configs</a> <li><a href="#producerconfigs">3.2 Producer Configs</a>
<li><a href="#newconsumerconfigs">3.3 New Consumer Configs</a> <li><a href="#consumerconfigs">3.3 Consumer Configs</a>
<li><a href="#producerconfigs">3.4 Kafka Producer Configs</a> <li><a href="#newconsumerconfigs">3.4 New Consumer Configs</a>
<li><a href="#oldproducerconfigs">3.5 Old Producer Configs</a>
</ul> </ul>
<li><a href="#design">4. Design</a> <li><a href="#design">4. Design</a>
<ul> <ul>

Loading…
Cancel
Save