Метод | Описание | |
---|---|---|
Dispose ( ) : void | ||
GetTopicFromCache ( string topic ) : KafkaNet.Protocol.Topic |
Get the metadata about a given topic.
|
|
GetTopicOffsetAsync ( string topic, int maxOffsets = 2, int time = -1 ) : Task
|
||
Producer ( IBrokerRouter brokerRouter, int maximumAsyncRequests = MaximumAsyncRequests, int maximumMessageBuffer = MaximumMessageBuffer ) : KafkaNet.Common |
Construct a Producer class. The maximumAsyncRequests parameter provides a mechanism for minimizing the amount of async requests in flight at any one time by blocking the caller requesting the async call. This affectively puts an upper limit on the amount of times a caller can call SendMessageAsync before the caller is blocked. The MaximumMessageBuffer parameter provides a way to limit the max amount of memory the driver uses should the send pipeline get overwhelmed and the buffer starts to fill up. This is an inaccurate limiting memory use as the amount of memory actually used is dependant on the general message size being buffered. A message will start its timeout countdown as soon as it is added to the producer async queue. If there are a large number of messages sitting in the async queue then a message may spend its entire timeout cycle waiting in this queue and never getting attempted to send to Kafka before a timeout exception is thrown. |
|
SendMessageAsync ( |
||
SendMessageAsync ( string topic ) : Task |
||
SendMessageAsync ( string topic, IEnumerable |
Send an enumerable of message objects to a given topic.
|
|
SendMessageAsync ( string topic, int partition ) : Task |
||
Stop ( bool waitForRequestsToComplete = true, System.TimeSpan maxWait = null ) : void |
Stops the producer from accepting new messages, and optionally waits for in-flight messages to be sent before returning.
|
Метод | Описание | |
---|---|---|
BatchSendAsync ( ) : Task | ||
IsNotDisposedOrHasMessagesToProcess ( ) : bool | ||
ProduceAndSendBatchAsync ( List |
||
SetResult ( List |
public GetTopicFromCache ( string topic ) : KafkaNet.Protocol.Topic | ||
topic | string | The name of the topic to get metadata for. |
Результат | KafkaNet.Protocol.Topic |
public GetTopicOffsetAsync ( string topic, int maxOffsets = 2, int time = -1 ) : Task
|
||
topic | string | |
maxOffsets | int | |
time | int | |
Результат | Task
|
public Producer ( IBrokerRouter brokerRouter, int maximumAsyncRequests = MaximumAsyncRequests, int maximumMessageBuffer = MaximumMessageBuffer ) : KafkaNet.Common | ||
brokerRouter | IBrokerRouter | The router used to direct produced messages to the correct partition. |
maximumAsyncRequests | int | The maximum async calls allowed before blocking new requests. -1 indicates unlimited. |
maximumMessageBuffer | int | The maximum amount of messages to buffer if the async calls are blocking from sending. |
Результат | KafkaNet.Common |
public SendMessageAsync ( |
||
messages | ||
topic | string | |
partition | int | |
acks | ||
Результат | Task |
public SendMessageAsync ( string topic ) : Task |
||
topic | string | |
Результат | Task |
public SendMessageAsync ( string topic, IEnumerable |
||
topic | string | The name of the kafka topic to send the messages to. |
messages | IEnumerable |
The enumerable of messages that will be sent to the given topic. |
acks | The required level of acknowlegment from the kafka server. 0=none, 1=writen to leader, 2+=writen to replicas, -1=writen to all replicas. | |
timeout | System.TimeSpan | Interal kafka timeout to wait for the requested level of ack to occur before returning. Defaults to 1000ms. |
codec | MessageCodec | The codec to apply to the message collection. Defaults to none. |
partition | int | |
Результат | Task |
public SendMessageAsync ( string topic, int partition ) : Task |
||
topic | string | |
partition | int | |
Результат | Task |
public Stop ( bool waitForRequestsToComplete = true, System.TimeSpan maxWait = null ) : void | ||
waitForRequestsToComplete | bool | True to wait for in-flight requests to complete, false otherwise. |
maxWait | System.TimeSpan | Maximum time to wait for in-flight requests to complete. Has no effect if |
Результат | void |