Consumer Sources are created with different types of subscriptions, which control from which topics, partitions and offsets data is to be consumed.
Subscriptions are grouped into two categories: with automatic partition assignment and with manual control of partition assignment.
Factory methods for all subscriptions can be found in the @apidoc[Subscriptions$] factory.
Subscribes to one or more topics. Partitions will be assigned automatically by the Kafka Client.
Scala : @@ snip snip { #single-topic }
Java : @@ snip snip { #single-topic }
Subscribes to one or more topics which match the given pattern. Take a look at the @javadocsubscribe​(java.util.regex.Pattern pattern, ...) method documentation for more information on topic pattern matching.
Scala : @@ snip snip { #topic-pattern }
Java : @@ snip snip { #topic-pattern }
Subscribes to given topics and their given partitions.
Scala : @@ snip snip { #assingment-single-partition }
Java : @@ snip snip { #assingment-single-partition }
Subscribes to given topics and their partitions allowing to also set an offset from which messages will be read.
Scala : @@ snip snip { #assingment-single-partition-offset }
Java : @@ snip snip { #assingment-single-partition-offset }
This subscription can be used when offsets are stored in Kafka or on external storage. For more information, take a look at the @refOffset Storage external to Kafka documentation page.
Subscribes to given topics and their partitions allowing to also set a timestamp which will be used to find the offset from which messages will be read.
Scala : @@ snip snip { #assingment-single-partition-timestamp }
Java : @@ snip snip { #assingment-single-partition-timestamp }