C# Class KafkaNet.KafkaMetadataProvider

This provider blocks while it attempts to get the MetaData configuration of the Kafka servers. If any retry errors occurs it will continue to block the downstream call and then repeatedly query kafka until the retry errors subside. This repeat call happens in a backoff manner, which each subsequent call waiting longer before a requery. Error Codes: LeaderNotAvailable = 5 NotLeaderForPartition = 6 ConsumerCoordinatorNotAvailableCode = 15 BrokerId = -1 Documentation: https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-MetadataResponse
Inheritance: IDisposable
Datei anzeigen Open project: gigya/KafkaNetClient Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
Get ( IKafkaConnection connections ) : Task

Given a collection of server connections, query for all topics metadata.

Get ( IKafkaConnection connections, IEnumerable topics ) : Task

Given a collection of server connections, query for the topic metadata.

KafkaMetadataProvider ( IKafkaLog log ) : KafkaNet.Protocol

Private Methods

Method Description
BackoffOnRetry ( int retryAttempt, bool performRetry ) : System.Threading.Tasks.Task
Get ( IKafkaConnection connections, MetadataRequest request ) : Task
GetMetadataResponse ( IKafkaConnection connections, MetadataRequest request ) : Task
ValidateBroker ( Broker broker ) : MetadataValidationResult
ValidateResponse ( MetadataResponse metadata ) : IEnumerable
ValidateTopic ( Topic topic ) : MetadataValidationResult

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Get() public method

Given a collection of server connections, query for all topics metadata.
public Get ( IKafkaConnection connections ) : Task
connections IKafkaConnection The server connections to query. Will cycle through the collection, starting at zero until a response is received.
return Task

Get() public method

Given a collection of server connections, query for the topic metadata.
public Get ( IKafkaConnection connections, IEnumerable topics ) : Task
connections IKafkaConnection The server connections to query. Will cycle through the collection, starting at zero until a response is received.
topics IEnumerable The collection of topics to get metadata for.
return Task

KafkaMetadataProvider() public method

public KafkaMetadataProvider ( IKafkaLog log ) : KafkaNet.Protocol
log IKafkaLog
return KafkaNet.Protocol