kafka.clients.producer
Class ProducerConfig

java.lang.Object
  extended by kafka.common.config.AbstractConfig
      extended by kafka.clients.producer.ProducerConfig

public class ProducerConfig
extends kafka.common.config.AbstractConfig

The producer configuration keys


Field Summary
static java.lang.String BLOCK_ON_BUFFER_FULL
          When our memory buffer is exhausted we must either stop accepting new records (block) or throw errors.
static java.lang.String BROKER_LIST_CONFIG
          A list of URLs to use for establishing the initial connection to the cluster.
static java.lang.String CLIENT_ID_CONFIG
          The id string to pass to the server when making requests.
static java.lang.String ENABLE_JMX
           
static java.lang.String LINGER_MS_CONFIG
          The producer groups together any records that arrive in between request sends.
static java.lang.String MAX_PARTITION_SIZE_CONFIG
          The buffer size allocated for a partition.
static java.lang.String MAX_REQUEST_SIZE_CONFIG
          The maximum size of a request.
static java.lang.String METADATA_FETCH_TIMEOUT_CONFIG
          The amount of time to block waiting to fetch metadata about a topic the first time a record is sent to that topic.
static java.lang.String METADATA_REFRESH_MS_CONFIG
          Force a refresh of the cluster metadata after this period of time.
static java.lang.String RECONNECT_BACKOFF_MS_CONFIG
          The amount of time to wait before attempting to reconnect to a given host.
static java.lang.String REQUEST_TIMEOUT_CONFIG
          The maximum amount of time the server will wait for acknowledgments from followers to meet the acknowledgment requirements the producer has specified.
static java.lang.String REQUIRED_ACKS_CONFIG
          The number of acknowledgments the producer requires from the server before considering a request complete.
static java.lang.String SEND_BUFFER_CONFIG
          The size of the TCP send buffer to use when sending data
static java.lang.String TOTAL_BUFFER_MEMORY_CONFIG
          The total memory used by the producer to buffer records waiting to be sent to the server.
 
Method Summary
 
Methods inherited from class kafka.common.config.AbstractConfig
get, getBoolean, getClass, getConfiguredInstance, getInt, getList, getLong, getString, unused
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BROKER_LIST_CONFIG

public static final java.lang.String BROKER_LIST_CONFIG
A list of URLs to use for establishing the initial connection to the cluster. This list should be in the form host1:port1,host2:port2,.... These urls are just used for the initial connection to discover the full cluster membership (which may change dynamically) so this list need not contain the full set of servers (you may want more than one, though, in case a server is down).

See Also:
Constant Field Values

METADATA_FETCH_TIMEOUT_CONFIG

public static final java.lang.String METADATA_FETCH_TIMEOUT_CONFIG
The amount of time to block waiting to fetch metadata about a topic the first time a record is sent to that topic.

See Also:
Constant Field Values

MAX_PARTITION_SIZE_CONFIG

public static final java.lang.String MAX_PARTITION_SIZE_CONFIG
The buffer size allocated for a partition. When records are received which are smaller than this size the producer will attempt to optimistically group them together until this size is reached.

See Also:
Constant Field Values

TOTAL_BUFFER_MEMORY_CONFIG

public static final java.lang.String TOTAL_BUFFER_MEMORY_CONFIG
The total memory used by the producer to buffer records waiting to be sent to the server. If records are sent faster than they can be delivered to the server the producer will either block or throw an exception based on the preference specified by BLOCK_ON_BUFFER_FULL.

See Also:
Constant Field Values

REQUIRED_ACKS_CONFIG

public static final java.lang.String REQUIRED_ACKS_CONFIG
The number of acknowledgments the producer requires from the server before considering a request complete.

See Also:
Constant Field Values

REQUEST_TIMEOUT_CONFIG

public static final java.lang.String REQUEST_TIMEOUT_CONFIG
The maximum amount of time the server will wait for acknowledgments from followers to meet the acknowledgment requirements the producer has specified. If the requested number of acknowledgments are not met an error will be returned.

See Also:
Constant Field Values

LINGER_MS_CONFIG

public static final java.lang.String LINGER_MS_CONFIG
The producer groups together any records that arrive in between request sends. Normally this occurs only under load when records arrive faster than they can be sent out. However the client can reduce the number of requests and increase throughput by adding a small amount of artificial delay to force more records to batch together. This setting gives an upper bound on this delay. If we get MAX_PARTITION_SIZE_CONFIG worth of records for a partition it will be sent immediately regardless of this setting, however if we have fewer than this many bytes accumulated for this partition we will "linger" for the specified time waiting for more records to show up. This setting defaults to 0.

See Also:
Constant Field Values

METADATA_REFRESH_MS_CONFIG

public static final java.lang.String METADATA_REFRESH_MS_CONFIG
Force a refresh of the cluster metadata after this period of time. This ensures that changes to the number of partitions or other settings will by taken up by producers without restart.

See Also:
Constant Field Values

CLIENT_ID_CONFIG

public static final java.lang.String CLIENT_ID_CONFIG
The id string to pass to the server when making requests. The purpose of this is to be able to track the source of requests beyond just ip/port by allowing a logical application name to be included.

See Also:
Constant Field Values

SEND_BUFFER_CONFIG

public static final java.lang.String SEND_BUFFER_CONFIG
The size of the TCP send buffer to use when sending data

See Also:
Constant Field Values

MAX_REQUEST_SIZE_CONFIG

public static final java.lang.String MAX_REQUEST_SIZE_CONFIG
The maximum size of a request. This is also effectively a cap on the maximum record size. Note that the server has its own cap on record size which may be different from this.

See Also:
Constant Field Values

RECONNECT_BACKOFF_MS_CONFIG

public static final java.lang.String RECONNECT_BACKOFF_MS_CONFIG
The amount of time to wait before attempting to reconnect to a given host. This avoids repeated connecting to a host in a tight loop.

See Also:
Constant Field Values

BLOCK_ON_BUFFER_FULL

public static final java.lang.String BLOCK_ON_BUFFER_FULL
When our memory buffer is exhausted we must either stop accepting new records (block) or throw errors. By default this setting is true and we block, however users who want to guarantee we never block can turn this into an error.

See Also:
Constant Field Values

ENABLE_JMX

public static final java.lang.String ENABLE_JMX
See Also:
Constant Field Values