*/
public KafkaConsumer build(final KafkaConsumerConfiguration configuration,
final ExecutorService executor,
final String name) {
final SynchronousConsumer consumer = new SynchronousConsumer<T>(
Consumer.createJavaConsumerConnector(toConsumerConfig(configuration)),
configuration.getPartitions(),
decoder,
processor,
executor,
configuration.getInitialRecoveryDelay(),
configuration.getMaxRecoveryDelay(),
configuration.getRetryResetDelay(),
configuration.getMaxRecoveryAttempts(),
configuration.isShutdownOnFatal(),
configuration.getShutdownGracePeriod());
//provide a reference to the Jetty server to the consumer
environment.addServerLifecycleListener(new ServerLifecycleListener() {
@Override
public void serverStarted(Server server) {
consumer.setServer(server);
}
});
// manage the consumer
environment.manage(consumer);