KafkaSession class

Session responsible for communication with Kafka cluster.

In order to create new Session you need to pass a list of ContactPoints to the constructor. Each ContactPoint is defined by a host and a port of one of the Kafka brokers. At least one ContactPoint is required to connect to the cluster, all the rest members of the cluster will be automatically detected by the Session.

For production deployments it is recommended to provide more than one ContactPoint since this will enable "failover" in case one of the instances is temporarily unavailable.

Constructors

KafkaSession.new(List<ContactPoint> contactPoints)
Creates new session.

Properties

contactPoints Queue<ContactPoint>
List of Kafka brokers which are used as initial contact points.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future
Closes this session and terminates all open socket connections.
getConsumerMetadata(String consumerGroup) Future<GroupCoordinatorResponse>
Fetches metadata for specified consumerGroup.
getMetadata(Set<String> topicNames, {bool invalidateCache = false}) Future<ClusterMetadata>
Fetches Kafka cluster metadata. If topicNames is null then metadata for all topics will be returned.
listTopics() Future<Set<String>>
Returns names of all existing topics in the Kafka cluster.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Broker broker, KafkaRequest request) Future
Sends request to specified Broker.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited