Interface ParallelConsumer<K,V>

Type Parameters:
K - key consume / produce key type
V - value consume / produce value type
All Superinterfaces:
AutoCloseable, Closeable, DrainingCloseable
All Known Subinterfaces:
ParallelStreamProcessor<K,V>
All Known Implementing Classes:
AbstractParallelEoSStreamProcessor, ExternalEngine, JStreamParallelEoSStreamProcessor, ParallelEoSStreamProcessor

public interface ParallelConsumer<K,V> extends DrainingCloseable
Asynchronous / concurrent message consumer for Kafka.

Currently there is no direct implementation, only the ParallelStreamProcessor version (see AbstractParallelEoSStreamProcessor), but there may be in the future.

See Also:
  • Method Details

    • subscribe

      void subscribe(Collection<String> topics)
      See Also:
      • KafkaConsumer.subscribe(Collection)
    • subscribe

      void subscribe(Pattern pattern)
      See Also:
      • KafkaConsumer.subscribe(Pattern)
    • subscribe

      void subscribe(Collection<String> topics, org.apache.kafka.clients.consumer.ConsumerRebalanceListener callback)
      See Also:
      • KafkaConsumer.subscribe(Collection, ConsumerRebalanceListener)
    • subscribe

      void subscribe(Pattern pattern, org.apache.kafka.clients.consumer.ConsumerRebalanceListener callback)
      See Also:
      • KafkaConsumer.subscribe(Pattern, ConsumerRebalanceListener)
    • pauseIfRunning

      void pauseIfRunning()
      Pause this consumer (i.e. stop processing of messages).

      This operation only has an effect if the consumer is currently running. In all other cases calling this method will be silent a no-op.

      Once the consumer is paused, the system will stop submitting work to the processing pool. Already submitted in flight work however will be finished. This includes work that is currently being processed inside a user function as well as work that has already been submitted to the processing pool but has not been picked up by a free worker yet.

      General remarks:

      • A paused consumer may still keep polling for new work until internal buffers are filled.
      • This operation does not actively pause the subscription on the underlying Kafka Broker (compared to KafkaConsumer#pause).
      • Pending offset commits will still be performed when the consumer is paused.
    • resumeIfPaused

      void resumeIfPaused()
      Resume this consumer (i.e. continue processing of messages).

      This operation only has an effect if the consumer is currently paused. In all other cases calling this method will be a silent no-op.