Interface KafkaStreamsContainer

    • Method Detail

      • restart

        void restart()
        Restarts this container.
      • close

        default void close​(Duration timeout)
        Closes this KafkaStreams instance.
      • close

        void close​(boolean cleanUp,
                   Duration timeout)
        Closes this KafkaStreams instance and wait up to the timeout for the streams to be closed. A timeout of 0 means to return immediately (i.e Duration.ZERO
        Parameters:
        cleanUp - flag to clean up the local streams states.
        timeout - the duration to wait for the streams to shutdown.
      • threadMetadata

        Set<org.apache.kafka.streams.processor.ThreadMetadata> threadMetadata()
        Gets the local thread metadata.
        Returns:
        a set of ThreadMetadata instance.
      • startedSince

        long startedSince()
        Gets the started epoch-time in milliseconds.
        Returns:
        a unix epoch-time in milliseconds.
      • streamsConfig

        Conf streamsConfig()
        Gets the configuration for this KafkaStreams instance.
        Returns:
        a Conf instance.
      • containerId

        String containerId()
        Gets the id for this container.
        Returns:
        a string container id.
      • applicationId

        String applicationId()
        Gets configured StreamsConfig.APPLICATION_ID_CONFIG for this KafkaStreams instance.
        Returns:
        a string application.id
      • endpoint

        Optional<Endpoint> endpoint()
        Gets the endpoint configured for this KafkaStreams instance.
        Returns:
        an optional Endpoint
        See Also:
        StreamsConfig.APPLICATION_SERVER_CONFIG
      • exception

        Optional<Throwable> exception()
        Gets the last observed exception thrown the KafkaStreams instance.
        Returns:
        a Throwable instance.
      • metrics

        default Set<MetricGroup> metrics()
        Gets all Metrics for this KafkaStreams instance.
        Returns:
        a Set of Metric.
        See Also:
        KafkaStreams.metrics()
      • offsets

        ConsumerGroupOffsets offsets()
        Gets the offsets for the topic/partitions assigned to this KafkaStreams instance. If the KafkaStreams instance is not running then no offsets will be computed.
        Returns:
        the ConsumerGroupOffsets.
      • defaultKeySerde

        Optional<org.apache.kafka.common.serialization.Serde> defaultKeySerde()
        Gets the default Serde configured for key.
        Returns:
        a optional Serde instance.
      • isRunning

        boolean isRunning()
        Checks if the KafkaStreams is either RUNNING or REBALANCING.
        Returns:
        false if no KafkaStreams is initialized.
      • getKafkaStreams

        default org.apache.kafka.streams.KafkaStreams getKafkaStreams()
        Returns the wrapped KafkaStreams instance. This method can throw an UnsupportedOperationException if the KafkaStreamsContainer implementation doesn't manage the KafkaStreams locally.
        Returns:
        the KafkaStreams.
      • getTopology

        default org.apache.kafka.streams.Topology getTopology()
        Returns the wrapped Topology instance. This method can throw an UnsupportedOperationException if the KafkaStreamsContainer implementation doesn't manage the KafkaStreams locally.
        Returns:
        the Topology instance.
      • checkEndpoint

        boolean checkEndpoint​(Endpoint endpoint)
        Checks whether the given Endpoint is the same as this container.
        Parameters:
        endpoint - the Endpoint to verify.
        Returns:
        true if the given host
      • createNewProducer

        org.apache.kafka.clients.producer.Producer<byte[],​byte[]> createNewProducer​(Map<String,​Object> overrides)
        Creates a new Producer instance using the same configs that the Kafka Streams instance.
        Parameters:
        overrides - the producer configs to overrides.
      • getAdminClient

        org.apache.kafka.clients.admin.AdminClient getAdminClient()
        Gets a shared AdminClient instance for this KafkaStreams instance.
        Returns:
        a AdminClient instance.
      • registerEventStream

        <K,​V> void registerEventStream​(EventStream<K,​V> eventStream)
        Registers a new EventStream to this container.
        Type Parameters:
        K - the record key-type.
        V - the record value-type.
        Parameters:
        eventStream - the EventStream to register.
      • listRegisteredEventStreamTypes

        Set<String> listRegisteredEventStreamTypes()
        Gets the set of registered event streams.
        Returns:
        the Set of event-streams.