Class AsyncConsumerImpl
java.lang.Object
com.here.platform.data.client.service.stream.kafka.AsyncConsumerImpl
- All Implemented Interfaces:
AsyncConsumer
Wrap java kafka consumer that must run in a single thread
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncConsumerImpl(String consumerKey, String dataClientKafkaConsumerId, org.apache.kafka.clients.consumer.Consumer<String, byte[]> consumer, scala.Function1<scala.collection.immutable.Vector<org.apache.kafka.clients.consumer.ConsumerRecord<String, byte[]>>, scala.runtime.BoxedUnit> callback, scala.Function1<Throwable, scala.runtime.BoxedUnit> onFailure, ClientExecutionContext clientExecutionContext) -
Method Summary
Modifier and TypeMethodDescriptionscala.concurrent.Future<org.apache.pekko.Done>close()final scala.concurrent.duration.FiniteDurationscala.concurrent.Future<org.apache.pekko.Done>commitOffset(scala.collection.immutable.Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> state) voidrequest()retrieveMetrics(scala.collection.immutable.List<String> metricNames) scala.concurrent.Future<org.apache.pekko.Done>stop()
-
Constructor Details
-
AsyncConsumerImpl
public AsyncConsumerImpl(String consumerKey, String dataClientKafkaConsumerId, org.apache.kafka.clients.consumer.Consumer<String, byte[]> consumer, scala.Function1<scala.collection.immutable.Vector<org.apache.kafka.clients.consumer.ConsumerRecord<String, byte[]>>, scala.runtime.BoxedUnit> callback, scala.Function1<Throwable, scala.runtime.BoxedUnit> onFailure, ClientExecutionContext clientExecutionContext)
-
-
Method Details
-
CloseKafkaTimeout
public final scala.concurrent.duration.FiniteDuration CloseKafkaTimeout() -
close
public scala.concurrent.Future<org.apache.pekko.Done> close()- Specified by:
closein interfaceAsyncConsumer
-
commitOffset
public scala.concurrent.Future<org.apache.pekko.Done> commitOffset(scala.collection.immutable.Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> state) - Specified by:
commitOffsetin interfaceAsyncConsumer
-
request
public void request()- Specified by:
requestin interfaceAsyncConsumer
-
retrieveMetrics
public scala.concurrent.Future<scala.collection.immutable.Map<String,String>> retrieveMetrics(scala.collection.immutable.List<String> metricNames) - Specified by:
retrieveMetricsin interfaceAsyncConsumer
-
stop
public scala.concurrent.Future<org.apache.pekko.Done> stop()- Specified by:
stopin interfaceAsyncConsumer
-