DVKafkaSocketClient class

Kafka over a socket, for a single-partition topic and a simple consumer.

Deliberately partial, and the two simplifications are load-bearing rather than shortcuts.

One partition. Ordering is only defined within a partition, so a queue spread across several would run work out of order while looking fine.

A simple consumer, not a group member. Kafka lets a client commit offsets for a group id without joining it, by sending generation -1 and an empty member id. That skips JoinGroup, SyncGroup and heartbeats entirely -- at the cost of no automatic partition rebalancing, which a single-partition queue does not need.

Implemented types

Properties

group → String
The consumer group whose committed offsets this client reads and writes.
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<void>
commit(String topic, int offset) → Future<void>
Commit offset as consumed, so a restart resumes after it.
override
committed(String topic) → Future<int>
The committed position, which is where a restart resumes.
override
endOffset(String topic) → Future<int>
The offset one past the last record.
override
ensureTopic(String topic) → Future<void>
Ask for a topic's metadata, which is also what creates it when the broker allows auto-creation.
fetchOne(String topic) → Future<DVKafkaRecord?>
Read one record from the committed position, or null when at the end.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
produce(String topic, List<int> value) → Future<int>
Append a record to topic, returning its offset.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

connect({String host = 'localhost', int port = 9092, String group = 'dartvel'}) → Future<DVKafkaSocketClient>