Skip to content

Instantly share code, notes, and snippets.

@ethrbunny
Last active August 31, 2016 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethrbunny/9ebb4e3e2b9babdea124fe8a6a7cf5cf to your computer and use it in GitHub Desktop.
Save ethrbunny/9ebb4e3e2b9babdea124fe8a6a7cf5cf to your computer and use it in GitHub Desktop.
Batch Processor Supplier (Kafka KStreams sample)
import org.apache.kafka.streams.processor.Processor;
import org.apache.kafka.streams.processor.ProcessorSupplier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BPS2 implements ProcessorSupplier<String, String> {
private static final Logger LOGGER = LoggerFactory.getLogger(BPS2.class);
@Override
public Processor<String, String> get() {
try {
return new BP2(30000);
} catch(Exception exception) {
LOGGER.error("Unable to instantiate BatchProcessor()", exception);
throw new RuntimeException();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment