Class KafkaStreamsFactory

java.lang.Object
io.micronaut.configuration.kafka.streams.KafkaStreamsFactory
All Implemented Interfaces:
io.micronaut.runtime.graceful.GracefulShutdownCapable, Closeable, AutoCloseable

@Factory @Requires(property="kafka.streams.enabled", notEquals="false", defaultValue="true") public class KafkaStreamsFactory extends Object implements Closeable, io.micronaut.runtime.graceful.GracefulShutdownCapable
A factory that constructs the KafkaStreams bean.
Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • KafkaStreamsFactory

      public KafkaStreamsFactory(io.micronaut.context.event.ApplicationEventPublisher eventPublisher, io.micronaut.context.ApplicationContext applicationContext)
      Default constructor.
      Parameters:
      eventPublisher - The event publisher
      applicationContext - The application context
  • Method Details

    • getStreams

      public Map<KafkaStreams, ConfiguredStreamBuilder> getStreams()
      Get configured stream and builder for the stream.
      Returns:
      Map of streams to builders
    • shutdownGracefully

      public CompletableFuture<Void> shutdownGracefully()
      Specified by:
      shutdownGracefully in interface io.micronaut.runtime.graceful.GracefulShutdownCapable
    • reportActiveTasks

      public OptionalLong reportActiveTasks()
      Specified by:
      reportActiveTasks in interface io.micronaut.runtime.graceful.GracefulShutdownCapable
    • close

      @PreDestroy public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable