C# Class Kafka.Client.Producer

Sends message to Kafka.
Exibir arquivo Open project: precog/kafka

Public Methods

Method Description
Producer ( string server, int port ) : System

Initializes a new instance of the Producer class.

Send ( MultiProducerRequest request ) : void

Sends a request to Kafka.

Send ( ProducerRequest request ) : void

Sends a request to Kafka.

Send ( string topic, int partition, IList messages ) : void

Sends a list of messages to Kafka.

Send ( string topic, int partition, Message msg ) : void

Sends a message to Kafka.

SendAsync ( ProducerRequest request, MessageSent callback ) : void

Send a request to Kafka asynchronously.

If the callback is not specified then the method behaves as a fire-and-forget call with the callback being ignored. By the time this callback is executed, the RequestContext.NetworkStream will already have been closed given an internal call NetworkStream.EndWrite.

SendAsync ( string topic, int partition, IList messages, MessageSent callback ) : void

Sends a list of messages to Kafka.

Method Details

Producer() public method

Initializes a new instance of the Producer class.
public Producer ( string server, int port ) : System
server string The server to connect to.
port int The port to connect to.
return System

Send() public method

Sends a request to Kafka.
public Send ( MultiProducerRequest request ) : void
request Kafka.Client.Request.MultiProducerRequest The request to send to Kafka.
return void

Send() public method

Sends a request to Kafka.
public Send ( ProducerRequest request ) : void
request ProducerRequest The request to send to Kafka.
return void

Send() public method

Sends a list of messages to Kafka.
public Send ( string topic, int partition, IList messages ) : void
topic string The topic to publish to.
partition int The partition to publish to.
messages IList The list of messages to send.
return void

Send() public method

Sends a message to Kafka.
public Send ( string topic, int partition, Message msg ) : void
topic string The topic to publish to.
partition int The partition to publish to.
msg Message The message to send.
return void

SendAsync() public method

Send a request to Kafka asynchronously.
If the callback is not specified then the method behaves as a fire-and-forget call with the callback being ignored. By the time this callback is executed, the RequestContext.NetworkStream will already have been closed given an internal call NetworkStream.EndWrite.
public SendAsync ( ProducerRequest request, MessageSent callback ) : void
request ProducerRequest The request to send to Kafka.
callback MessageSent /// A block of code to execute once the request has been sent to Kafka. This value may /// be set to null. ///
return void

SendAsync() public method

Sends a list of messages to Kafka.
public SendAsync ( string topic, int partition, IList messages, MessageSent callback ) : void
topic string The topic to publish to.
partition int The partition to publish to.
messages IList The list of messages to send.
callback MessageSent /// A block of code to execute once the request has been sent to Kafka. This value may /// be set to null. ///
return void