Interface IStreamConsumer<T>
- Type Parameters:
T
- the type of data being consumed
- All Known Implementing Classes:
KafkaStreamConsumer
public interface IStreamConsumer<T>
Provide a consumer interface for reading data from streams.
- Since:
- 24.4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the consumer.Lists the streams available for consumption.Polls data from the stream.void
shutdown()
shutdown the consumer.(This method will wake up stream consumer before closing)Subscribes to a single topic.Subscribes to multiple topics.void
wakeup()
Wakes up the consumer to process data.
-
Method Details
-
subscribe
Subscribes to a single topic.- Parameters:
topic
- the topic to subscribe to- Returns:
- the stream consumer instance
-
subscribe
Subscribes to multiple topics.- Parameters:
topics
- the list of topics to subscribe to- Returns:
- the stream consumer instance
-
listStreams
Lists the streams available for consumption.- Returns:
- a list of streams
- Throws:
StreamWakeupException
-
wakeup
void wakeup()Wakes up the consumer to process data. -
shutdown
void shutdown()shutdown the consumer.(This method will wake up stream consumer before closing) -
close
void close()Closes the consumer. -
poll
Polls data from the stream.- Returns:
- the data polled from the stream
- Throws:
StreamWakeupException
- If wakeup method be called.
-