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
Methods
-
close(
) → Future< void> -
commit(
String topic, int offset) → Future< void> -
Commit
offsetas 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