Class KafkaRecordStreamSubscription<K,V,T>
java.lang.Object
io.smallrye.reactive.messaging.kafka.impl.KafkaRecordStreamSubscription<K,V,T>
- Type Parameters:
K- type of incoming record keyV- type of incoming record payloadT- type of the items to emit downstream
- All Implemented Interfaces:
Flow.Subscription
A
Flow.Subscription which, on request(long), polls ConsumerRecords from the given consumer client
and emits records downstream.
It uses an internal queue to store records received but not yet emitted downstream.
The given enqueue function can flatten the polled ConsumerRecords into individual records or enqueue it as-is.
-
Constructor Summary
ConstructorsConstructorDescriptionKafkaRecordStreamSubscription(ReactiveKafkaConsumer<K, V> client, RuntimeKafkaSourceConfiguration config, io.smallrye.mutiny.subscription.MultiSubscriber<? super T> subscriber, io.vertx.core.Context context, int maxPollRecords, BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecords<K, V>, RecordQueue<T>> enqueueFunction) -
Method Summary
-
Constructor Details
-
KafkaRecordStreamSubscription
public KafkaRecordStreamSubscription(ReactiveKafkaConsumer<K, V> client, RuntimeKafkaSourceConfiguration config, io.smallrye.mutiny.subscription.MultiSubscriber<? super T> subscriber, io.vertx.core.Context context, int maxPollRecords, BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecords<K, V>, RecordQueue<T>> enqueueFunction)
-
-
Method Details
-
request
public void request(long n) - Specified by:
requestin interfaceFlow.Subscription
-
cancel
public void cancel()- Specified by:
cancelin interfaceFlow.Subscription
-