Type Parameters:
K - Key type
V - Value type
All Implemented Interfaces:

public class KafkaPublisher<K,V> extends Object implements Publisher<KafkaMessage<K,V>>
This is an implementation of Publisher that read messages from Kafka and push them downstream to one subscriber. Configurable by Helidon Config,
See Also:
  • Method Details

    • stop

      public void stop()
      Closes the opened resources to Kafka and completes exceptionally the pending Message.ack(). It must be invoked after ScheduledExecutorService is shutdown.
    • runInNewContext

      protected void runInNewContext(Runnable runnable)
    • subscribe

      public void subscribe(Subscriber<? super KafkaMessage<K,V>> subscriber)
      Specified by:
      subscribe in interface Publisher<K>
    • builder

      public static <K, V> KafkaPublisher.Builder<K,V> builder()
      A builder for KafkaPublisher.
      Type Parameters:
      K - Key type
      V - Value type
      builder to create a new instance
    • create

      public static <K, V> KafkaPublisher<K,V> create(Config config)
      Load this builder from a configuration.
      Type Parameters:
      K - Key type
      V - Value type
      config - configuration to load from
      updated builder instance