com.datasift.dropwizard.kafka.consumer.StreamProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-extra-kafka Show documentation
Show all versions of dropwizard-extra-kafka Show documentation
Dropwizard integration for working with Kafka.
The newest version!
package com.datasift.dropwizard.kafka.consumer;
import kafka.message.MessageAndMetadata;
/**
* Processes an {@link Iterable} of messages of type {@code T}.
*
* If you wish to process each message individually and iteratively, it's advised that you instead
* use a {@link MessageProcessor}, as it provides a higher-level of abstraction.
*
* Note: since consumers may use multiple threads, it is important that implementations are
* thread-safe.
*/
public interface StreamProcessor {
/**
* Process an {@link Iterable} of messages of type T.
*
* @param stream the stream of messages to process.
* @param topic the topic the {@code stream} belongs to.
*/
public void process(Iterable> stream, String topic);
}